diff options
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr46065.C | 11 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 51e2171..04f95bb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-11-10 Nathan Froyd <froydnj@codesourcery.com> + + PR c++/46065 + * decl.c (poplevel_named_label_1): Use TREE_CHAIN if necessary. + 2010-11-09 Jakub Jelinek <jakub@redhat.com> PR c++/45894 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c372840..93af4b4 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -475,7 +475,11 @@ poplevel_named_label_1 (void **slot, void *data) { tree decl; - for (decl = ent->names_in_scope; decl; decl = DECL_CHAIN (decl)) + /* ENT->NAMES_IN_SCOPE may contain a mixture of DECLs and + TREE_LISTs representing OVERLOADs, so be careful. */ + for (decl = ent->names_in_scope; decl; decl = (DECL_P (decl) + ? DECL_CHAIN (decl) + : TREE_CHAIN (decl))) if (decl_jump_unsafe (decl)) VEC_safe_push (tree, gc, ent->bad_decls, decl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0d71195..5560ede 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-11-10 Nathan Froyd <froydnj@codesourcery.com> + + PR c++/46065 + * g++.dg/pr46065.C: New test. + 2010-11-10 Jan Hubicka <jh@suse.cz> PR tree-optimize/33172 diff --git a/gcc/testsuite/g++.dg/pr46065.C b/gcc/testsuite/g++.dg/pr46065.C new file mode 100644 index 0000000..75c171d --- /dev/null +++ b/gcc/testsuite/g++.dg/pr46065.C @@ -0,0 +1,11 @@ +// PR c++/46065 +// { dg-do compile } + +void bar (); + +void +foo () +{ + using ::bar; +label:; +} |