aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-07-14 05:12:56 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-07-14 05:12:56 +0000
commita3d8777127800e056bf525c39ab4f7bd72b7818b (patch)
tree87f9283f2bab95f2d3eae355b5779dedea7a7f1b /gcc/cp/search.c
parentb34459943bbfaf3f6fb32408bec5443b5bd007a9 (diff)
downloadgcc-a3d8777127800e056bf525c39ab4f7bd72b7818b.zip
gcc-a3d8777127800e056bf525c39ab4f7bd72b7818b.tar.gz
gcc-a3d8777127800e056bf525c39ab4f7bd72b7818b.tar.bz2
re PR c++/11503 (segfault when instantiating template with ADDR_EXPR)
PR c++/11503 * g++.dg/template/anon1.C: New test. PR c++/11503 * cp-tree.h (DECL_SELF_REFERENCE_P): New macro. (SET_DECL_SELF_REFERENCE_P): Likewise. * class.c (build_self_reference): Use SET_DECL_SELF_REFERENCE_P. * pt.c (tsubst_decl): Copy it. * search.c (lookup_base): Use DECL_SELF_REFERENCE_P. From-SVN: r69317
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index c2c158a..1161084 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -305,9 +305,7 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
/* Rather than inventing a public member, we use the implicit
public typedef created in the scope of every class. */
decl = TYPE_FIELDS (base);
- while (TREE_CODE (decl) != TYPE_DECL
- || !DECL_ARTIFICIAL (decl)
- || DECL_NAME (decl) != constructor_name (base))
+ while (!DECL_SELF_REFERENCE_P (decl))
decl = TREE_CHAIN (decl);
while (ANON_AGGR_TYPE_P (t))
t = TYPE_CONTEXT (t);