Commit 7299275f by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/84662 (internal compiler error: tree check: expected class 'type',…

re PR c++/84662 (internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in is_bitfield_expr_with_lowered_type, at cp/typeck.c:1944)

	PR c++/84662
	* pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use
	RETURN instead of return.
	<case POINTER_PLUS_EXPR>: Likewise.
	<case CONVERT_EXPR>: If op0 is error_mark_node, just return
	it instead of wrapping it into CONVERT_EXPR.

	* g++.dg/cpp1y/pr84662.C: New test.

From-SVN: r258146
parent e76feb5b
2018-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/84662
* pt.c (tsubst_copy_and_build) <case TEMPLATE_ID_EXPR>: Use
RETURN instead of return.
<case POINTER_PLUS_EXPR>: Likewise.
<case CONVERT_EXPR>: If op0 is error_mark_node, just return
it instead of wrapping it into CONVERT_EXPR.
2018-03-02 Jason Merrill <jason@redhat.com>
Fix MIPS16 ICE.
......
......@@ -17318,14 +17318,14 @@ tsubst_copy_and_build (tree t,
if (targs)
targs = tsubst_template_args (targs, args, complain, in_decl);
if (targs == error_mark_node)
return error_mark_node;
RETURN (error_mark_node);
if (TREE_CODE (templ) == SCOPE_REF)
{
tree name = TREE_OPERAND (templ, 1);
tree tid = lookup_template_function (name, targs);
TREE_OPERAND (templ, 1) = tid;
return templ;
RETURN (templ);
}
if (variable_template_p (templ))
......@@ -17401,6 +17401,8 @@ tsubst_copy_and_build (tree t,
{
tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
tree op0 = RECUR (TREE_OPERAND (t, 0));
if (op0 == error_mark_node)
RETURN (error_mark_node);
RETURN (build1 (CONVERT_EXPR, type, op0));
}
......@@ -17549,7 +17551,7 @@ tsubst_copy_and_build (tree t,
{
tree op0 = RECUR (TREE_OPERAND (t, 0));
tree op1 = RECUR (TREE_OPERAND (t, 1));
return fold_build_pointer_plus (op0, op1);
RETURN (fold_build_pointer_plus (op0, op1));
}
case SCOPE_REF:
......
2018-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/84662
* g++.dg/cpp1y/pr84662.C: New test.
2018-03-02 Thomas Schwinge <thomas@codesourcery.com>
* g++.dg/lto/20080915_0.C: Don't use "dg-lto-options".
......
// PR c++/84662
// { dg-do compile { target c++14 } }
// { dg-options "" }
double b;
a (__attribute__((c (0 && int() - ([] {} && b) || auto)))); // { dg-error "expected constructor, destructor, or type conversion before" }
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