Commit 0abbc99c by Paolo Carlini Committed by Paolo Carlini

re PR c++/84661 (internal compiler error: Segmentation fault (strip_array_types()))

/cp
2019-03-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84661
	PR c++/85013
	* parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
	to undo the disabling of warnings.

/testsuite
2019-03-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84661
	PR c++/85013
	* g++.dg/concepts/pr84661.C: New.
	* g++.dg/torture/pr85013.C: Likewise.

From-SVN: r269923
parent b25e675d
2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84661
PR c++/85013
* parser.c (cp_parser_binary_expression): Don't call cp_fully_fold
to undo the disabling of warnings.
2019-03-25 Jason Merrill <jason@redhat.com> 2019-03-25 Jason Merrill <jason@redhat.com>
PR c++/87748 - substitution failure error with decltype. PR c++/87748 - substitution failure error with decltype.
......
...@@ -9443,6 +9443,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, ...@@ -9443,6 +9443,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
{ {
cp_parser_expression_stack stack; cp_parser_expression_stack stack;
cp_parser_expression_stack_entry *sp = &stack[0]; cp_parser_expression_stack_entry *sp = &stack[0];
cp_parser_expression_stack_entry *disable_warnings_sp = NULL;
cp_parser_expression_stack_entry current; cp_parser_expression_stack_entry current;
cp_expr rhs; cp_expr rhs;
cp_token *token; cp_token *token;
...@@ -9506,12 +9507,14 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, ...@@ -9506,12 +9507,14 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
/* For "false && x" or "true || x", x will never be executed; /* For "false && x" or "true || x", x will never be executed;
disable warnings while evaluating it. */ disable warnings while evaluating it. */
if (current.tree_type == TRUTH_ANDIF_EXPR) if ((current.tree_type == TRUTH_ANDIF_EXPR
c_inhibit_evaluation_warnings += && cp_fully_fold (current.lhs) == truthvalue_false_node)
cp_fully_fold (current.lhs) == truthvalue_false_node; || (current.tree_type == TRUTH_ORIF_EXPR
else if (current.tree_type == TRUTH_ORIF_EXPR) && cp_fully_fold (current.lhs) == truthvalue_true_node))
c_inhibit_evaluation_warnings += {
cp_fully_fold (current.lhs) == truthvalue_true_node; disable_warnings_sp = sp;
++c_inhibit_evaluation_warnings;
}
/* Extract another operand. It may be the RHS of this expression /* Extract another operand. It may be the RHS of this expression
or the LHS of a new, higher priority expression. */ or the LHS of a new, higher priority expression. */
...@@ -9557,12 +9560,11 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, ...@@ -9557,12 +9560,11 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
} }
/* Undo the disabling of warnings done above. */ /* Undo the disabling of warnings done above. */
if (current.tree_type == TRUTH_ANDIF_EXPR) if (sp == disable_warnings_sp)
c_inhibit_evaluation_warnings -= {
cp_fully_fold (current.lhs) == truthvalue_false_node; disable_warnings_sp = NULL;
else if (current.tree_type == TRUTH_ORIF_EXPR) --c_inhibit_evaluation_warnings;
c_inhibit_evaluation_warnings -= }
cp_fully_fold (current.lhs) == truthvalue_true_node;
if (warn_logical_not_paren if (warn_logical_not_paren
&& TREE_CODE_CLASS (current.tree_type) == tcc_comparison && TREE_CODE_CLASS (current.tree_type) == tcc_comparison
2019-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84661
PR c++/85013
* g++.dg/concepts/pr84661.C: New.
* g++.dg/torture/pr85013.C: Likewise.
2019-03-25 Marek Polacek <polacek@redhat.com> 2019-03-25 Marek Polacek <polacek@redhat.com>
PR c++/89214 - ICE when initializing aggregates with bases. PR c++/89214 - ICE when initializing aggregates with bases.
......
// { dg-do compile { target c++14 } }
// { dg-additional-options "-fconcepts" }
struct S {
int &a;
void foo (decltype(((a = 0) || ((auto))))); // { dg-error "expected" }
};
// { dg-additional-options "-std=c++14 -fconcepts" }
a(decltype((0 > 1e91 && 1e31 && (auto)))); // { dg-error "expected" }
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