diff options
author | Jason Merrill <jason@redhat.com> | 2010-02-17 17:51:43 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-02-17 17:51:43 -0500 |
commit | 77278f4acb960227639ab6ad6ded471f82503f51 (patch) | |
tree | 5cfc9ee0fc24e68bffb90b1414b930318ee5daf7 | |
parent | 85a52ea58cdcfe9c292d62b3e06149eea2f49eb9 (diff) | |
download | gcc-77278f4acb960227639ab6ad6ded471f82503f51.zip gcc-77278f4acb960227639ab6ad6ded471f82503f51.tar.gz gcc-77278f4acb960227639ab6ad6ded471f82503f51.tar.bz2 |
re PR c++/43069 (ICE: tree check: expected tree that contains 'decl minimal' structure, have 'overload' in set_decl_namespace, at cp/name-lookup.c:3105)
PR c++/43069
* name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
decl we looked up doesn't match.
From-SVN: r156841
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/namespace11.C | 7 |
4 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ab5fbe5..ef12985 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2010-02-17 Jason Merrill <jason@redhat.com> + PR c++/43069 + * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the + decl we looked up doesn't match. + PR c++/43093 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't have an INIT_EXPR anymore. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 1f595c0..7b43d30 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3102,7 +3102,8 @@ set_decl_namespace (tree decl, tree scope, bool friendp) if (!is_overloaded_fn (decl)) { /* We might have found OLD in an inline namespace inside SCOPE. */ - DECL_CONTEXT (decl) = DECL_CONTEXT (old); + if (TREE_CODE (decl) == TREE_CODE (old)) + DECL_CONTEXT (decl) = DECL_CONTEXT (old); /* Don't compare non-function decls with decls_match here, since it can't check for the correct constness at this point. pushdecl will find those errors later. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 34729bc..d2b7655 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2010-02-17 Jason Merrill <jason@redhat.com> + PR c++/43069 + * g++.dg/parse/namespace11.C: New. + PR c++/43093 * g++.dg/ext/attrib37.C: New. diff --git a/gcc/testsuite/g++.dg/parse/namespace11.C b/gcc/testsuite/g++.dg/parse/namespace11.C new file mode 100644 index 0000000..7fa73b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/namespace11.C @@ -0,0 +1,7 @@ +// PR c++/43069 + +namespace std { + template < typename > + void swap (); +} +template std::swap // { dg-error "" } |