summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C
new file mode 100644
index 0000000000..eb585a89be
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-4.C
@@ -0,0 +1,30 @@
+// { dg-options "-Wunused -pedantic-errors" }
+// { dg-do compile { target c++11 } }
+// Test for syntax support of various attribute permutations.
+
+int
+[[noreturn]] // { dg-warning "ignored" }
+one
+[[gnu::unused]]
+(void);
+
+int one_third [[noreturn]] [[gnu::unused]] (void);
+
+int [[gnu::unused]] one_half(); // { dg-warning "ignored" }
+
+static
+[[noreturn]] // { dg-warning "ignored" }
+void two [[gnu::unused]] (void) {}
+
+
+
+[[gnu::unused]]
+int
+five(void)
+[[noreturn]] // { dg-warning "ignored" }
+{}
+
+[[noreturn]]
+void
+six (void)
+;