From: Jakub Jelinek Date: Fri, 2 Mar 2018 17:07:39 +0000 (+0100) Subject: re PR c++/84662 (internal compiler error: tree check: expected class 'type', have... X-Git-Tag: upstream/12.2.0~33080 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7299275f74a31f7f3774ade89c7447fc6fb7cf98;p=platform%2Fupstream%2Fgcc.git 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) : Use RETURN instead of return. : Likewise. : 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9986b88..79e0d8f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2018-03-02 Jakub Jelinek + + PR c++/84662 + * pt.c (tsubst_copy_and_build) : Use + RETURN instead of return. + : Likewise. + : If op0 is error_mark_node, just return + it instead of wrapping it into CONVERT_EXPR. + 2018-03-02 Jason Merrill Fix MIPS16 ICE. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f67080f..c81bd50 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3864204..0c73e80 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-02 Jakub Jelinek + + PR c++/84662 + * g++.dg/cpp1y/pr84662.C: New test. + 2018-03-02 Thomas Schwinge * g++.dg/lto/20080915_0.C: Don't use "dg-lto-options". diff --git a/gcc/testsuite/g++.dg/cpp1y/pr84662.C b/gcc/testsuite/g++.dg/cpp1y/pr84662.C new file mode 100644 index 0000000..36bd201 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr84662.C @@ -0,0 +1,6 @@ +// 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" }