Commit 2601a4ee by Mark Mitchell Committed by Mark Mitchell

re PR c++/9336 (ICE in cp_line_of, at cp/error.c:2191)

	PR c++/9336
	* g++.dg/parse/namespace8.C: New test.

	PR c++/9336
	* decl2.c (do_nonmember_using_decl): Do not call duplicate decls
	to merge old and new declarations.

From-SVN: r64216
parent 21282b1e
2003-03-11 Mark Mitchell <mark@codesourcery.com>
PR c++/9336
* decl2.c (do_nonmember_using_decl): Do not call duplicate decls
to merge old and new declarations.
2003-03-12 Alexandre Oliva <aoliva@redhat.com> 2003-03-12 Alexandre Oliva <aoliva@redhat.com>
* g++.1: Remove. * g++.1: Remove.
...@@ -8,6 +14,10 @@ ...@@ -8,6 +14,10 @@
2003-03-11 Mark Mitchell <mark@codesourcery.com> 2003-03-11 Mark Mitchell <mark@codesourcery.com>
PR c++/9336
* decl2.c (do_nonmember_using_decl): Do not call duplicate decls
to merge old and new declarations.
PR c++/9924 PR c++/9924
* decl2.c (do_nonmember_using_decl): Ignore anticipated builtins. * decl2.c (do_nonmember_using_decl): Ignore anticipated builtins.
......
...@@ -4222,12 +4222,6 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, ...@@ -4222,12 +4222,6 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
{ {
tree tmp, tmp1; tree tmp, tmp1;
if (oldval && !is_overloaded_fn (oldval))
{
duplicate_decls (OVL_CURRENT (BINDING_VALUE (decls)), oldval);
oldval = NULL_TREE;
}
*newval = oldval; *newval = oldval;
for (tmp = BINDING_VALUE (decls); tmp; tmp = OVL_NEXT (tmp)) for (tmp = BINDING_VALUE (decls); tmp; tmp = OVL_NEXT (tmp))
{ {
...@@ -4290,12 +4284,12 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype, ...@@ -4290,12 +4284,12 @@ do_nonmember_using_decl (tree scope, tree name, tree oldval, tree oldtype,
else else
{ {
*newval = BINDING_VALUE (decls); *newval = BINDING_VALUE (decls);
if (oldval) if (oldval && !decls_match (*newval, oldval))
duplicate_decls (*newval, oldval); error ("`%D' is already declared in this scope", name);
} }
*newtype = BINDING_TYPE (decls); *newtype = BINDING_TYPE (decls);
if (oldtype && *newtype && oldtype != *newtype) if (oldtype && *newtype && !same_type_p (oldtype, *newtype))
{ {
error ("using declaration `%D' introduced ambiguous type `%T'", error ("using declaration `%D' introduced ambiguous type `%T'",
name, oldtype); name, oldtype);
......
2003-03-11 Mark Mitchell <mark@codesourcery.com> 2003-03-11 Mark Mitchell <mark@codesourcery.com>
PR c++/9336
* g++.dg/parse/namespace8.C: New test.
PR c++/9924 PR c++/9924
* g++.dg/overload/builtin2.C: New test. * g++.dg/overload/builtin2.C: New test.
......
namespace X {
typedef struct {
} x;
}
typedef X::x x;
using X::x;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment