diff options
author | Dodji Seketeli <dodji@redhat.com> | 2011-11-09 19:25:01 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2011-11-09 20:25:01 +0100 |
commit | 5cc66776c46dedbda21a89d5422663feb4a7cc45 (patch) | |
tree | 879f1208f4c187ae8a3fdfb36ce8df485d3a4b98 | |
parent | e7a82751a55254b5c88748453415dc17b5ee9ae7 (diff) | |
download | gcc-5cc66776c46dedbda21a89d5422663feb4a7cc45.zip gcc-5cc66776c46dedbda21a89d5422663feb4a7cc45.tar.gz gcc-5cc66776c46dedbda21a89d5422663feb4a7cc45.tar.bz2 |
PR c++/51043 - ICE in LTO
* cp-tree.h (TYPE_ALIAS_P, TYPE_TEMPLATE_INFO): Don't crash on
NULL TYPE_NAME.
From-SVN: r181231
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 23 |
2 files changed, 16 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9c5a2bc..a545511 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -41,6 +41,10 @@ 2011-11-09 Dodji Seketeli <dodji@redhat.com> + PR c++/51043 + * cp-tree.h (TYPE_ALIAS_P, TYPE_TEMPLATE_INFO): Don't crash on + NULL TYPE_NAME. + PR c++/51027 * parser.c (cp_parser_alias_declaration): Require ';' at the end of the declaration. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 5ba1885..b306976 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2550,8 +2550,9 @@ extern void decl_shadowed_for_var_insert (tree, tree); /* Nonzero for a type which is an alias for another type; i.e, a type which declaration was written 'using name-of-type = another-type'. */ -#define TYPE_ALIAS_P(NODE) \ - (TYPE_P (NODE) \ +#define TYPE_ALIAS_P(NODE) \ + (TYPE_P (NODE) \ + && TYPE_NAME (NODE) \ && TYPE_DECL_ALIAS_P (TYPE_NAME (NODE))) /* For a class type: if this structure has many fields, we'll sort them @@ -2605,15 +2606,15 @@ extern void decl_shadowed_for_var_insert (tree, tree); ->template_info) /* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE. */ -#define TYPE_TEMPLATE_INFO(NODE) \ - (TREE_CODE (NODE) == ENUMERAL_TYPE \ - ? ENUM_TEMPLATE_INFO (NODE) : \ - (TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM \ - ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) : \ - ((CLASS_TYPE_P (NODE) && !TYPE_ALIAS_P (NODE)) \ - ? CLASSTYPE_TEMPLATE_INFO (NODE) \ - : (DECL_LANG_SPECIFIC (TYPE_NAME (NODE)) \ - ? (DECL_TEMPLATE_INFO (TYPE_NAME (NODE))) \ +#define TYPE_TEMPLATE_INFO(NODE) \ + (TREE_CODE (NODE) == ENUMERAL_TYPE \ + ? ENUM_TEMPLATE_INFO (NODE) : \ + (TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM \ + ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) : \ + ((CLASS_TYPE_P (NODE) && !TYPE_ALIAS_P (NODE)) \ + ? CLASSTYPE_TEMPLATE_INFO (NODE) \ + : ((TYPE_NAME (NODE) && DECL_LANG_SPECIFIC (TYPE_NAME (NODE))) \ + ? (DECL_TEMPLATE_INFO (TYPE_NAME (NODE))) \ : NULL_TREE)))) /* Set the template information for an ENUMERAL_, RECORD_, or |