From 52fc15ab5ef4ff9c4337c8a5e9e6bd7fe862edbc Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 24 May 2002 19:13:48 +0000 Subject: [PATCH] re PR preprocessor/6780 (Incorrect diagnosis of token pasting) 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 | 5 +++++ gcc/cppmacro.c | 2 ++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/cpp/paste12.c | 8 ++++++++ 4 files changed, 19 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cpp/paste12.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dde3ea05e2ca..af5dd08dbf02 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-05-24 Neil Booth + + PR preprocessor/6780 + * cppmacro.c (enter_macro_context): Clear state.angled_headers. + 2002-05-21 Richard Earnshaw * bitmap.c (bitmap_find_bit): Return early if we have the correct diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index b351f96631f7..e9f9e7ba7ad5 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -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)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 55aaf0c102f4..226aec5d7292 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-05-24 Neil Booth + + * gcc.dg/cpp/paste12.c: New test. + 2002-05-24 Neil Booth * 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 index 000000000000..e61ec51433c0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/paste12.c @@ -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" } */ -- 2.47.2