* name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
decl we looked up doesn't match.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156841
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
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. */
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.
--- /dev/null
+// PR c++/43069
+
+namespace std {
+ template < typename >
+ void swap ();
+}
+template std::swap // { dg-error "" }