aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1999-04-19 21:21:00 -0400
committerJason Merrill <jason@gcc.gnu.org>1999-04-19 21:21:00 -0400
commit3d6b96617891cf51b41ebcd5b569d3d668932e24 (patch)
tree89660f58bd201c1f0b9df6a2b80b18ab4d7c2482
parent419c62125982f257ef80953a416a58153608ffee (diff)
downloadgcc-3d6b96617891cf51b41ebcd5b569d3d668932e24.zip
gcc-3d6b96617891cf51b41ebcd5b569d3d668932e24.tar.gz
gcc-3d6b96617891cf51b41ebcd5b569d3d668932e24.tar.bz2
new
From-SVN: r26559
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/attrib4.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/attrib4.C b/gcc/testsuite/g++.old-deja/g++.ext/attrib4.C
new file mode 100644
index 0000000..5200eac
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/attrib4.C
@@ -0,0 +1,24 @@
+// Test that attributes are really applied to function declarations under
+// various conditions.
+// Contributed by Jason Merrill (jason@cygnus.com)
+// Special g++ Options: -Wformat
+// Build don't link:
+
+#define PF __attribute__ ((format (printf, 1, 2)))
+
+struct A {
+ static PF void f (char *, ...);
+ friend PF void g (char *, ...);
+ static void test ();
+};
+
+void PF h (char *, ...);
+void PF k (char *, ...) { }
+
+void A::test ()
+{
+ f ("%f", 42); // WARNING -
+ g ("%f", 42); // WARNING -
+ h ("%f", 42); // WARNING -
+ k ("%f", 42); // WARNING -
+}