diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-07-14 05:12:56 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-07-14 05:12:56 +0000 |
commit | a3d8777127800e056bf525c39ab4f7bd72b7818b (patch) | |
tree | 87f9283f2bab95f2d3eae355b5779dedea7a7f1b /gcc/cp/cp-tree.h | |
parent | b34459943bbfaf3f6fb32408bec5443b5bd007a9 (diff) | |
download | gcc-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/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 24fd278..32b791f 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -97,6 +97,7 @@ struct diagnostic_context; 3: DECL_IN_AGGR_P. 4: DECL_C_BIT_FIELD (in a FIELD_DECL) DECL_VAR_MARKED_P (in a VAR_DECL) + DECL_SELF_REFERENCE_P (in a TYPE_DECL) 5: DECL_INTERFACE_KNOWN. 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL). 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL). @@ -2751,16 +2752,20 @@ struct lang_decl GTY(()) (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE)) /* Nonzero if NODE is the typedef implicitly generated for a type when - the type is declared. (In C++, `struct S {};' is roughly equivalent - to `struct S {}; typedef struct S S;' in C. This macro will hold - for the typedef indicated in this example. Note that in C++, there - is a second implicit typedef for each class, in the scope of `S' - itself, so that you can say `S::S'. This macro does *not* hold for - those typedefs. */ + the type is declared. In C++, `struct S {};' is roughly + equivalent to `struct S {}; typedef struct S S;' in C. + DECL_IMPLICIT_TYPEDEF_P will hold for the typedef indicated in this + example. In C++, there is a second implicit typedef for each + class, in the scope of `S' itself, so that you can say `S::S'. + DECL_SELF_REFERENCE_P will hold for that second typedef. */ #define DECL_IMPLICIT_TYPEDEF_P(NODE) \ (TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_2 (NODE)) #define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \ (DECL_LANG_FLAG_2 (NODE) = 1) +#define DECL_SELF_REFERENCE_P(NODE) \ + (TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_4 (NODE)) +#define SET_DECL_SELF_REFERENCE_P(NODE) \ + (DECL_LANG_FLAG_4 (NODE) = 1) /* A `primary' template is one that has its own template header. A member function of a class template is a template, but not primary. |