aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-attr-deprecated-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/c23-attr-deprecated-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/c23-attr-deprecated-4.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c23-attr-deprecated-4.c b/gcc/testsuite/gcc.dg/c23-attr-deprecated-4.c
new file mode 100644
index 0000000..aa0d8e5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c23-attr-deprecated-4.c
@@ -0,0 +1,11 @@
+/* Test C23 deprecated attribute: duplicates (allowed after N2557). */
+/* { dg-do compile } */
+/* { dg-options "-std=c23 -pedantic-errors" } */
+
+[[deprecated, __deprecated__]] int a;
+[[__deprecated__, deprecated("message")]] int b;
+int c [[deprecated("message"), deprecated]];
+[[deprecated, deprecated]];
+/* { dg-error "ignored" "ignored" { target *-*-* } .-1 } */
+
+[[deprecated]] [[deprecated]] int d [[deprecated]] [[deprecated]];