Commit eaf1ece1 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/77638 (ICE on x86_64-linux-gnu (internal compiler error: tree check:…

re PR c++/77638 (ICE on x86_64-linux-gnu (internal compiler error: tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in cp_parser_template_declaration_after_parameters, at cp/parser.c:25722))

	PR c++/77638
	* parser.c (cp_parser_template_declaration_after_parameter): For 2
	argument operator"" template set ok to false for
	parm == error_mark_node.

	* g++.dg/cpp0x/udlit-tmpl-arg-neg2.C: New test.

From-SVN: r240266
parent 590b62e9
2016-09-20 Jakub Jelinek <jakub@redhat.com> 2016-09-20 Jakub Jelinek <jakub@redhat.com>
PR c++/77638
* parser.c (cp_parser_template_declaration_after_parameter): For 2
argument operator"" template set ok to false for
parm == error_mark_node.
PR c++/77637 PR c++/77637
* parser.c (cp_parser_std_attribute_list): Reject ... without * parser.c (cp_parser_std_attribute_list): Reject ... without
preceding attribute. preceding attribute.
......
...@@ -25723,7 +25723,8 @@ cp_parser_template_declaration_after_parameters (cp_parser* parser, ...@@ -25723,7 +25723,8 @@ cp_parser_template_declaration_after_parameters (cp_parser* parser,
tree type = INNERMOST_TEMPLATE_PARMS (parm_type); tree type = INNERMOST_TEMPLATE_PARMS (parm_type);
tree parm_list = TREE_VEC_ELT (parameter_list, 1); tree parm_list = TREE_VEC_ELT (parameter_list, 1);
tree parm = INNERMOST_TEMPLATE_PARMS (parm_list); tree parm = INNERMOST_TEMPLATE_PARMS (parm_list);
if (TREE_TYPE (parm) != TREE_TYPE (type) if (parm == error_mark_node
|| TREE_TYPE (parm) != TREE_TYPE (type)
|| !TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm))) || !TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm)))
ok = false; ok = false;
} }
2016-09-20 Jakub Jelinek <jakub@redhat.com> 2016-09-20 Jakub Jelinek <jakub@redhat.com>
PR c++/77638
* g++.dg/cpp0x/udlit-tmpl-arg-neg2.C: New test.
PR c++/77637 PR c++/77637
* g++.dg/cpp0x/gen-attrs-62.C: New test. * g++.dg/cpp0x/gen-attrs-62.C: New test.
......
// PR c++/77638
// { dg-do compile { target c++11 } }
template <T, T... U> // { dg-error "'T' has not been declared" }
int operator"" _foo (); // { dg-error "has invalid parameter list" }
template <T... U> // { dg-error "'T' has not been declared" }
int operator"" _bar (); // { dg-error "has invalid parameter list" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment