diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-02-19 07:05:55 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-02-19 07:05:55 +0100 |
commit | 179652df338a0dfe4e121cb6b88164a723d91528 (patch) | |
tree | f3fc813b3068ddef834ae78c747c34b6b87b8722 /gcc | |
parent | 0cfe1b4698da3b3ef6b75142f0daef9687e4d63a (diff) | |
download | gcc-179652df338a0dfe4e121cb6b88164a723d91528.zip gcc-179652df338a0dfe4e121cb6b88164a723d91528.tar.gz gcc-179652df338a0dfe4e121cb6b88164a723d91528.tar.bz2 |
re PR preprocessor/58844 (ICE with invalid use of ##)
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.
From-SVN: r207871
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-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 |
3 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6ca2560..f64bb4f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-02-19 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/58844 + * c-c++-common/cpp/pr58844-1.c: New test. + * c-c++-common/cpp/pr58844-2.c: New test. + 2014-02-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/60225 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 0000000..3abf8a7 --- /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 0000000..1e21915 --- /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" } */ |