Commit ba18e4db by Mark Mitchell Committed by Mark Mitchell

re PR c++/15862 ('enum yn' fails)

	PR c++/15862
	* name-lookup.c (unqualified_namespace_lookup): Do not ignore type
	bindings for undeclared built-ins.

	PR c++/15862
	* g++.dg/parse/enum1.C: New test.

From-SVN: r82986
parent e6ff425c
2004-06-11 Mark Mitchell <mark@codesourcery.com>
PR c++/15862
* name-lookup.c (unqualified_namespace_lookup): Do not ignore type
bindings for undeclared built-ins.
2004-06-11 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* typeck2.c (abstract_virtual_errors): Reword diagnostics, make them
......
......@@ -3761,16 +3761,17 @@ unqualified_namespace_lookup (tree name, int flags)
cxx_binding *b =
cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
/* Ignore anticipated built-in functions. */
if (b && b->value && DECL_P (b->value)
&& DECL_LANG_SPECIFIC (b->value) && DECL_ANTICIPATED (b->value))
/* Keep binding cleared. */;
else if (b)
{
/* Initialize binding for this context. */
binding.value = b->value;
binding.type = b->type;
}
if (b)
{
if (b->value && DECL_P (b->value)
&& DECL_LANG_SPECIFIC (b->value)
&& DECL_ANTICIPATED (b->value))
/* Ignore anticipated built-in functions. */
;
else
binding.value = b->value;
binding.type = b->type;
}
/* Add all _DECLs seen through local using-directives. */
for (level = current_binding_level;
......
2004-06-11 Mark Mitchell <mark@codesourcery.com>
PR c++/15862
* g++.dg/parse/enum1.C: New test.
2004-06-10 Jeff Law <law@redhat.com>
* gcc.c-torture/compile/20040610-1.c: New test.
......
// PR c++/15862
enum yn { Y, N };
enum yn x = Y;
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