From aba254d025f229a70fd96429adc6c88cf0a4a005 Mon Sep 17 00:00:00 2001 From: mpolacek Date: Wed, 22 Feb 2017 19:31:49 +0000 Subject: PR c++/79653 * parser.c (cp_parser_std_attribute_spec): Don't build the attribute if the alignas expression is erroneous. * pt.c (tsubst_attribute): If tsubst_pack_expansion fails, return error_mark_node. * g++.dg/cpp0x/alignas10.C: New test. * g++.dg/cpp0x/alignas9.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245657 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/pt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/cp/pt.c') diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 38a01e168a7..5b0f62d3832 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -10012,6 +10012,8 @@ tsubst_attribute (tree t, tree *decl_p, tree args, /* An attribute pack expansion. */ tree purp = TREE_PURPOSE (t); tree pack = tsubst_pack_expansion (val, args, complain, in_decl); + if (pack == error_mark_node) + return error_mark_node; int len = TREE_VEC_LENGTH (pack); tree list = NULL_TREE; tree *q = &list; -- cgit v1.2.3