diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a0d2b067492..f746718a7a5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-03-10 Mark Mitchell + + PR c++/14510 + * decl.c (xref_tag): Disregard non-type declarations when + looking up a tagged type. + 2004-03-09 Nathan Sidwell PR c++/14397 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index c2698ecf4a6..e642c26b27a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9305,7 +9305,7 @@ xref_tag (enum tag_types tag_code, tree name, } else { - tree decl = lookup_name (name, 1); + tree decl = lookup_name (name, 2); if (decl && DECL_CLASS_TEMPLATE_P (decl)) decl = DECL_TEMPLATE_RESULT (decl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 21b2f0583dd..df12379d38e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-03-10 Mark Mitchell + + PR c++/14510 + * g++.dg/lookup/struct2.C: New test. + 2004-03-10 Uros Bizjak * gcc.dg/builtins-34.c: New test. diff --git a/gcc/testsuite/g++.dg/lookup/struct2.C b/gcc/testsuite/g++.dg/lookup/struct2.C new file mode 100644 index 00000000000..a66f403c291 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/struct2.C @@ -0,0 +1,7 @@ +// PR c++/14510 + +struct c {}; +namespace A { + int c(struct c*req); +} +int A::c(struct c*req) {}