aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-02-02 21:41:35 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-02-02 21:41:35 +0000
commit5237f531dafcdf5a118ec501b0bbea1ee4e0928c (patch)
tree85f4994520bd25edda71f41ae96e75498894cb12 /gcc/testsuite
parent3e7cd49fee867f8af4815815ded1dd621d27ceab (diff)
downloadgcc-5237f531dafcdf5a118ec501b0bbea1ee4e0928c.zip
gcc-5237f531dafcdf5a118ec501b0bbea1ee4e0928c.tar.gz
gcc-5237f531dafcdf5a118ec501b0bbea1ee4e0928c.tar.bz2
cpplib.h (cpp_reader): Add new flag, no_directives.
* cpplib.h (cpp_reader): Add new flag, no_directives. * cpphash.c (macarg): Set it. * cpplib.c (handle_directive): If no_directives is on and we find a directive, issue an error and discard the line. From-SVN: r31763
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/undef.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/undef.c b/gcc/testsuite/gcc.dg/undef.c
new file mode 100644
index 0000000..024efce
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/undef.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+
+/* 6.9.3.11: ...If there are sequences of preprocessing tokens within
+ the list of arguments that would otherwise act as preprocessing
+ directives, the behavior is undefined.
+
+ I choose to make this a hard error. It definitely should not cause
+ a core dump. */
+
+#define foo(bar) bar
+
+foo( blah
+#undef foo /* { dg-error "may not be used inside" "foo(#undef foo)" } */
+ blah )