]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR preprocessor/6780 (Incorrect diagnosis of token pasting)
authorNeil Booth <neil@daikokuya.demon.co.uk>
Fri, 24 May 2002 19:13:48 +0000 (19:13 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 24 May 2002 19:13:48 +0000 (19:13 +0000)
PR preprocessor/6780
* cppmacro.c (enter_macro_context): Clear state.angled_headers.
testsuite:
* gcc.dg/cpp/paste12.c: New test.

From-SVN: r53848

gcc/ChangeLog
gcc/cppmacro.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/paste12.c [new file with mode: 0644]

index dde3ea05e2ca704971deb019b35f569e9a38b71a..af5dd08dbf02adefef1c38b8866b34da1f461c4f 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-24  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       PR preprocessor/6780
+       * cppmacro.c (enter_macro_context): Clear state.angled_headers.
+
 2002-05-21  Richard Earnshaw  <rearnsha@arm.com>
 
        * bitmap.c (bitmap_find_bit): Return early if we have the correct
index b351f96631f7a55f9f7a02ae23dda095ce858c10..e9f9e7ba7ad5e98739a28a7a087cc40c6cbf31bc 100644 (file)
@@ -673,6 +673,8 @@ enter_macro_context (pfile, node)
   /* The presence of a macro invalidates a file's controlling macro.  */
   pfile->mi_valid = false;
 
+  pfile->state.angled_headers = false;
+
   /* Handle standard macros.  */
   if (! (node->flags & NODE_BUILTIN))
     {
index 55aaf0c102f43ec01797a2474a109e33f3ebcfb1..226aec5d7292b2ece1ea853c2d5a719084892960 100644 (file)
@@ -1,3 +1,7 @@
+2002-05-24  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+       * gcc.dg/cpp/paste12.c: New test.
+
 2002-05-24  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * g++.dg/parse/named_ops.C: New test.
diff --git a/gcc/testsuite/gcc.dg/cpp/paste12.c b/gcc/testsuite/gcc.dg/cpp/paste12.c
new file mode 100644 (file)
index 0000000..e61ec51
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+
+/* Test correct diagnostics when pasting in #include.
+   Source: PR preprocessor/6780.  */
+
+#define inc2(a,b) <##a.b>
+#define INC(X) inc2(X,h)
+#include INC(stdio) /* { dg-error "pasting \"<\" and \"stdio\" does not" } */