diff options
author | Marek Polacek <polacek@redhat.com> | 2015-07-08 10:36:26 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-07-08 10:36:26 +0000 |
commit | 7b3bc1f3bdc39883d1d3575341b280a762731a5b (patch) | |
tree | eb4298eb09493245f072bb119f21feab7fa7240b /gcc/cp | |
parent | daee9ce2953033be80e974fd467201934eb1ed01 (diff) | |
download | gcc-7b3bc1f3bdc39883d1d3575341b280a762731a5b.zip gcc-7b3bc1f3bdc39883d1d3575341b280a762731a5b.tar.gz gcc-7b3bc1f3bdc39883d1d3575341b280a762731a5b.tar.bz2 |
re PR c++/66748 (Crash with abi_tag attribute)
PR c++/66748
* tree.c (handle_abi_tag_attribute): Check for CLASS_TYPE_P before
accessing TYPE_LANG_SPECIFIC node.
* g++.dg/abi/abi-tag15.C: New test.
From-SVN: r225541
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/tree.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c345f83..e469156 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-07-08 Marek Polacek <polacek@redhat.com> + + PR c++/66748 + * tree.c (handle_abi_tag_attribute): Check for CLASS_TYPE_P before + accessing TYPE_LANG_SPECIFIC node. + 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 4fcdb6c..149c37d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -3653,13 +3653,15 @@ handle_abi_tag_attribute (tree* node, tree name, tree args, name, *node); goto fail; } - else if (CLASSTYPE_TEMPLATE_INSTANTIATION (*node)) + else if (CLASS_TYPE_P (*node) + && CLASSTYPE_TEMPLATE_INSTANTIATION (*node)) { warning (OPT_Wattributes, "ignoring %qE attribute applied to " "template instantiation %qT", name, *node); goto fail; } - else if (CLASSTYPE_TEMPLATE_SPECIALIZATION (*node)) + else if (CLASS_TYPE_P (*node) + && CLASSTYPE_TEMPLATE_SPECIALIZATION (*node)) { warning (OPT_Wattributes, "ignoring %qE attribute applied to " "template specialization %qT", name, *node); |