summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/attrib18.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/attrib18.C')
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib18.C10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/attrib18.C b/gcc/testsuite/g++.dg/ext/attrib18.C
new file mode 100644
index 000000000..ab9fea095
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib18.C
@@ -0,0 +1,10 @@
+// PR c++/17542
+// Test that we warn when an attribute preceding the class-key is ignored.
+// { dg-do compile }
+
+__attribute__ ((packed)) struct A // { dg-warning "attribute" }
+{
+ char c;
+ int x;
+ void f();
+};