summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-11 18:14:52 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-11 18:14:52 +0000
commit93dbdf3c8494e8bd15e390dfd267dd2a267148e4 (patch)
tree3a88e5e64afa9c690c328f36beb93348389ef616 /gcc/cp
parent177ffb18df7c9e0601ced6f6819048caa91ef402 (diff)
downloadgcc-93dbdf3c8494e8bd15e390dfd267dd2a267148e4.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82986 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/name-lookup.c21
2 files changed, 17 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6ab2a7a5ce7..4b4e42c95c9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 238023da877..d470251d317 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -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;