diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-03-10 20:10:43 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-03-10 20:10:43 +0100 |
commit | 704c79040af06477eaa18ee560270f22214a359a (patch) | |
tree | 51bc9fc082d586c29d0154b2c033b978184d6529 /gcc | |
parent | 1574ecc09cc471c9461abcfe467dfd3b4e8daf96 (diff) | |
download | gcc-704c79040af06477eaa18ee560270f22214a359a.zip gcc-704c79040af06477eaa18ee560270f22214a359a.tar.gz gcc-704c79040af06477eaa18ee560270f22214a359a.tar.bz2 |
re PR c++/65127 (internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'addr_expr' in parsing_nsdmi, at cp/parser.c:18311)
PR c++/65127
* parser.c (parsing_nsdmi): Don't return true if current_class_ptr
is not a PARM_DECL.
* g++.dg/cpp0x/pr65127.C: New test.
From-SVN: r221332
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr65127.C | 16 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 61c0b18..1202b0f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-03-10 Jakub Jelinek <jakub@redhat.com> + + PR c++/65127 + * parser.c (parsing_nsdmi): Don't return true if current_class_ptr + is not a PARM_DECL. + 2015-03-10 Jason Merrill <jason@redhat.com> PR c++/65333 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ad132b1..a209ee6 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -18314,7 +18314,9 @@ parsing_nsdmi (void) { /* We recognize NSDMI context by the context-less 'this' pointer set up by the function above. */ - if (current_class_ptr && DECL_CONTEXT (current_class_ptr) == NULL_TREE) + if (current_class_ptr + && TREE_CODE (current_class_ptr) == PARM_DECL + && DECL_CONTEXT (current_class_ptr) == NULL_TREE) return true; return false; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4899406..e0daa10 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-10 Jakub Jelinek <jakub@redhat.com> + + PR c++/65127 + * g++.dg/cpp0x/pr65127.C: New test. + 2015-03-10 Jan Hubicka <hubicka@ucw.cz> * gcc.dg/ipa/PR64550.c: Update template. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr65127.C b/gcc/testsuite/g++.dg/cpp0x/pr65127.C new file mode 100644 index 0000000..2cdb8ee --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr65127.C @@ -0,0 +1,16 @@ +// PR c++/65127 +// { dg-do compile { target c++11 } } + +template <int N> +void +foo () +{ + static int i {100}; + struct { int id {i++}; } j; +} + +int +main () +{ + foo<0> (); +} |