Commit ff8fe3e0 by Volker Reichelt Committed by Volker Reichelt

re PR c++/27933 (ICE with invalid "using")

	PR c++/27933
	* name-lookup.c (lookup_qualified_name): Always return error_mark_node
	if lookup fails.

	* g++.dg/lookup/using15.C: New test.

From-SVN: r114580
parent 8bdb09cb
2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27933
* name-lookup.c (lookup_qualified_name): Always return error_mark_node
if lookup fails.
PR c++/27951 PR c++/27951
* decl2.c (finish_anon_union): Return early if build_anon_union_vars * decl2.c (finish_anon_union): Return early if build_anon_union_vars
fails. fails.
......
...@@ -3713,6 +3713,7 @@ tree ...@@ -3713,6 +3713,7 @@ tree
lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain) lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain)
{ {
int flags = 0; int flags = 0;
tree t = NULL_TREE;
if (TREE_CODE (scope) == NAMESPACE_DECL) if (TREE_CODE (scope) == NAMESPACE_DECL)
{ {
...@@ -3722,17 +3723,14 @@ lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain) ...@@ -3722,17 +3723,14 @@ lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain)
if (is_type_p) if (is_type_p)
flags |= LOOKUP_PREFER_TYPES; flags |= LOOKUP_PREFER_TYPES;
if (qualified_lookup_using_namespace (name, scope, &binding, flags)) if (qualified_lookup_using_namespace (name, scope, &binding, flags))
return select_decl (&binding, flags); t = select_decl (&binding, flags);
} }
else if (is_aggr_type (scope, complain)) else if (is_aggr_type (scope, complain))
{ t = lookup_member (scope, name, 2, is_type_p);
tree t;
t = lookup_member (scope, name, 2, is_type_p);
if (t)
return t;
}
return error_mark_node; if (!t)
return error_mark_node;
return t;
} }
/* Subroutine of unqualified_namespace_lookup: /* Subroutine of unqualified_namespace_lookup:
......
2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-06-12 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27933
* g++.dg/lookup/using15.C: New test.
PR c++/27951 PR c++/27951
* g++.dg/other/anon4.C: New test. * g++.dg/other/anon4.C: New test.
// PR c++/27933
// { dg-do compile }
template<int> struct A
{
int i;
A() { using i; } // { dg-error "nested-name-specifier|declared" }
};
A<0> a;
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