aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-bool-errors-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/c23-bool-errors-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/c23-bool-errors-2.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c23-bool-errors-2.c b/gcc/testsuite/gcc.dg/c23-bool-errors-2.c
new file mode 100644
index 0000000..1a66e3a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c23-bool-errors-2.c
@@ -0,0 +1,9 @@
+/* Test error-handling for legacy code that tries to
+ use a variable named "bool" with C23. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c23" } */
+
+int bool; /* { dg-error "'bool' cannot be used here" } */
+/* { dg-message "'bool' is a keyword with '-std=c23' onwards" "" { target *-*-* } .-1 } */
+/* { dg-warning "useless type name in empty declaration" "" { target *-*-* } .-2 } */