PR c++/20240
* decl.c (decls_match): Compare context of VAR_DECL.
* g++.dg/lookup/using13.C: New test.
From-SVN: r96725
+2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/20240
+ * decl.c (decls_match): Compare context of VAR_DECL.
+
2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/20333
}
else
{
+ /* Need to check scope for variable declaration (VAR_DECL).
+ For typedef (TYPE_DECL), scope is ignored. */
+ if (TREE_CODE (newdecl) == VAR_DECL
+ && CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl))
+ return 0;
+
if (TREE_TYPE (newdecl) == error_mark_node)
types_match = TREE_TYPE (olddecl) == error_mark_node;
else if (TREE_TYPE (olddecl) == NULL_TREE)
+2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/20240
+ * g++.dg/lookup/using13.C: New test.
+
2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/20333
--- /dev/null
+// { dg-do compile }
+
+// Origin: Stefan Straßer <sstrasser@systemhaus-gruppe.de>
+
+// PR c++/20240:
+
+namespace A { int a; }
+
+namespace C{
+ int a;
+ using A::a; // { dg-error "already declared" }
+}