diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-19 06:05:55 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-02-19 06:05:55 +0000 |
| commit | 9b48364fddff647aa4036a47ddceb623f63fce15 (patch) | |
| tree | f3fc813b3068ddef834ae78c747c34b6b87b8722 /gcc/testsuite/c-c++-common/cpp | |
| parent | 76a2f4fff059dc28d4e481fbef538828478ff22e (diff) | |
| download | ppe42-gcc-9b48364fddff647aa4036a47ddceb623f63fce15.tar.gz ppe42-gcc-9b48364fddff647aa4036a47ddceb623f63fce15.zip | |
PR preprocessor/58844
* macro.c (enter_macro_context): Only push
macro_real_token_count (macro) tokens rather than
macro->count tokens, regardless of
CPP_OPTION (pfile, track-macro-expansion).
* c-c++-common/cpp/pr58844-1.c: New test.
* c-c++-common/cpp/pr58844-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207871 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/c-c++-common/cpp')
| -rw-r--r-- | gcc/testsuite/c-c++-common/cpp/pr58844-1.c | 8 | ||||
| -rw-r--r-- | gcc/testsuite/c-c++-common/cpp/pr58844-2.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/cpp/pr58844-1.c b/gcc/testsuite/c-c++-common/cpp/pr58844-1.c new file mode 100644 index 00000000000..3abf8a76803 --- /dev/null +++ b/gcc/testsuite/c-c++-common/cpp/pr58844-1.c @@ -0,0 +1,8 @@ +/* PR preprocessor/58844 */ +/* { dg-do compile } */ +/* { dg-options "-ftrack-macro-expansion=0" } */ + +#define A x######x +int A = 1; +#define A x######x /* { dg-message "previous definition" } */ +#define A x##x /* { dg-warning "redefined" } */ diff --git a/gcc/testsuite/c-c++-common/cpp/pr58844-2.c b/gcc/testsuite/c-c++-common/cpp/pr58844-2.c new file mode 100644 index 00000000000..1e219152fc5 --- /dev/null +++ b/gcc/testsuite/c-c++-common/cpp/pr58844-2.c @@ -0,0 +1,8 @@ +/* PR preprocessor/58844 */ +/* { dg-do compile } */ +/* { dg-options "-ftrack-macro-expansion=2" } */ + +#define A x######x +int A = 1; +#define A x######x /* { dg-message "previous definition" } */ +#define A x##x /* { dg-warning "redefined" } */ |

