aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-09-20 17:17:41 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-09-20 17:17:41 +0200
commiteaf1ece1315e4fc7356e9fb24e07c4bd86c73f14 (patch)
tree7d5967c69ac06d2e7a5f0e9354b946b4a56ee352 /gcc/cp
parent590b62e90d6d86e68442ffa608c7c6e5653736d5 (diff)
downloadgcc-eaf1ece1315e4fc7356e9fb24e07c4bd86c73f14.zip
gcc-eaf1ece1315e4fc7356e9fb24e07c4bd86c73f14.tar.gz
gcc-eaf1ece1315e4fc7356e9fb24e07c4bd86c73f14.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 35ad431..5efc795 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
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
* parser.c (cp_parser_std_attribute_list): Reject ... without
preceding attribute.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 9a20a5f..168486c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -25723,7 +25723,8 @@ cp_parser_template_declaration_after_parameters (cp_parser* parser,
tree type = INNERMOST_TEMPLATE_PARMS (parm_type);
tree parm_list = TREE_VEC_ELT (parameter_list, 1);
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)))
ok = false;
}