diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-03-21 16:35:26 +0000 |
---|---|---|
committer | Paolo Carlini <paolo.carlini@oracle.com> | 2014-03-21 16:35:26 +0000 |
commit | 885ed7d6b1823aba3574d81dc31f7af6fe9ff8db (patch) | |
tree | 70fbfb08b2563f3ed88157e26fb7ddbfccefbfb4 | |
parent | 166ceab3c04667aef8bc23f57f73c041058a1471 (diff) |
/cp
2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60384
* name-lookup.c (push_class_level_binding_1): Check identifier_p
on the name argument.
/testsuite
2014-03-21 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60384
* g++.dg/cpp1y/pr60384.C: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@208752 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/pr60384.C | 9 |
4 files changed, 27 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3d043d95f13..1acfec335f6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-03-21 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/60384 + * name-lookup.c (push_class_level_binding_1): Check identifier_p + on the name argument. + 2014-03-20 Jakub Jelinek <jakub@redhat.com> PR c++/60572 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index ea16061f2ae..53f14f3eee6 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3115,6 +3115,13 @@ push_class_level_binding_1 (tree name, tree x) if (name == error_mark_node) return false; + /* Can happen for an erroneous declaration (c++/60384). */ + if (!identifier_p (name)) + { + gcc_assert (errorcount || sorrycount); + return false; + } + /* Check for invalid member names. But don't worry about a default argument-scope lambda being pushed after the class is complete. */ gcc_assert (TYPE_BEING_DEFINED (current_class_type) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a04e2d02896..a57529844c8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-21 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/60384 + * g++.dg/cpp1y/pr60384.C: New. + 2014-03-21 Jakub Jelinek <jakub@redhat.com> PR target/60598 diff --git a/gcc/testsuite/g++.dg/cpp1y/pr60384.C b/gcc/testsuite/g++.dg/cpp1y/pr60384.C new file mode 100644 index 00000000000..f206647e640 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr60384.C @@ -0,0 +1,9 @@ +// PR c++/60384 +// { dg-do compile { target c++1y } } + +template<typename> int foo(); + +struct A +{ + typedef auto foo<>(); // { dg-error "typedef declared 'auto'" } +}; |