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

From-SVN: r53851

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

index 29027a11361ba26999672234ba9f28e2daaa2921..cfcc5fbeb047d6effddaa537e7cd7877072f7026 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-24  Jim Blandy  <jimb@redhat.com>
 
        * dwarf2out.c (dwarf2out_finish): Don't forget to emit a final
index 40a9a0780453188933e265017edf25880f1e9627..d154c0ccb85d8bfaff2cf7024398ce0a086e71a8 100644 (file)
@@ -660,6 +660,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 ae26d864ae1df03773778c79aa89349c89e66949..deabe47ee7aa667d5b734859fb0c2bf70c5f4826 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-23  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" } */
This page took 0.115739 seconds and 5 git commands to generate.