diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-03-09 08:26:14 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-03-09 08:26:14 +0000 |
commit | 62d99768eba4f3906639a234eb1f17b4630aecad (patch) | |
tree | 81908ffe911816861e54657dcd277cbabb315762 /gcc | |
parent | 58ec3cc5c0c441e0e8c49c029be9e25dcb1d853d (diff) | |
download | gcc-62d99768eba4f3906639a234eb1f17b4630aecad.zip gcc-62d99768eba4f3906639a234eb1f17b4630aecad.tar.gz gcc-62d99768eba4f3906639a234eb1f17b4630aecad.tar.bz2 |
re PR c++/14432 (Built-ins lead to conflict even if no header file included)
PR c++/14432
* name-lookup.c (supplement_binding): Ignore functions that are
marked DECL_ANTICIPATED.
PR c++/14432
* g++.dg/parse/builtin2.C: New test.
From-SVN: r79160
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 21 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/builtin2.C | 5 |
4 files changed, 30 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 21ca2f9..2f684b4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-03-09 Mark Mitchell <mark@codesourcery.com> + + PR c++/14432 + * name-lookup.c (supplement_binding): Ignore functions that are + marked DECL_ANTICIPATED. + 2004-03-08 Mark Mitchell <mark@codesourcery.com> PR c++/14401 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 82e583c..ce101de 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -439,13 +439,20 @@ supplement_binding (cxx_binding *binding, tree decl) if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)) /* The new name is the type name. */ binding->type = decl; - else if (!bval || bval == error_mark_node) - /* VALUE is null when push_class_level_binding moves an inherited - type-binding out of the way to make room for a new value binding. - It is an error_mark_node when DECL's name has been used in a - non-class scope prior declaration. In that case, we should have - already issued a diagnostic; for graceful error recovery purpose, - pretend this was the intended declaration for that name. */ + else if (/* BVAL is null when push_class_level_binding moves an + inherited type-binding out of the way to make room for a + new value binding. */ + !bval + /* BVAL is error_mark_node when DECL's name has been used + in a non-class scope prior declaration. In that case, + we should have already issued a diagnostic; for graceful + error recovery purpose, pretend this was the intended + declaration for that name. */ + || bval == error_mark_node + /* If BVAL is a built-in that has not yet been declared, + pretend it is not there at all. */ + || (TREE_CODE (bval) == FUNCTION_DECL + && DECL_ANTICIPATED (bval))) binding->value = decl; else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6eb9b55..8e55c0e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-03-09 Mark Mitchell <mark@codesourcery.com> + + PR c++/14432 + * g++.dg/parse/builtin2.C: New test. + 2004-03-08 Mark Mitchell <mark@codesourcery.com> PR c++/14401 diff --git a/gcc/testsuite/g++.dg/parse/builtin2.C b/gcc/testsuite/g++.dg/parse/builtin2.C new file mode 100644 index 0000000..c524ea6 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/builtin2.C @@ -0,0 +1,5 @@ +// PR c++/14432 +// { dg-options "" } + +struct Y {}; +Y y1; |