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
This commit is contained in:
Mark Mitchell 2004-06-11 18:14:52 +00:00 committed by Mark Mitchell
parent e6ff425c00
commit ba18e4dbfc
4 changed files with 26 additions and 10 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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;

View File

@ -1,3 +1,8 @@
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.

View File

@ -0,0 +1,4 @@
// PR c++/15862
enum yn { Y, N };
enum yn x = Y;