Commit c9db39e1 by Jakub Jelinek Committed by Jakub Jelinek

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

re PR c++/85015 (internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in build_int_cst, at tree.c:1360)

	PR c++/85015
	* decl.c (compute_array_index_type): Set osize to mark_rvalue_use
	result.

	* g++.dg/cpp0x/pr85015.C: New test.

From-SVN: r258822
parent c1e7c3f2
2018-03-23 Jakub Jelinek <jakub@redhat.com>
PR c++/85015
* decl.c (compute_array_index_type): Set osize to mark_rvalue_use
result.
PR c++/84942
* pt.c (tsubst_copy_and_build) <case FIX_TRUNC_EXPR>: Replace
cp_build_unary_op call with gcc_unreachable ().
......
......@@ -9520,7 +9520,7 @@ compute_array_index_type (tree name, tree size, tsubst_flags_t complain)
if (!type_dependent_expression_p (size))
{
size = mark_rvalue_use (size);
osize = size = mark_rvalue_use (size);
if (cxx_dialect < cxx11 && TREE_CODE (size) == NOP_EXPR
&& TREE_SIDE_EFFECTS (size))
......
2018-03-23 Jakub Jelinek <jakub@redhat.com>
PR c++/85015
* g++.dg/cpp0x/pr85015.C: New test.
PR c++/84942
* g++.dg/cpp1y/pr84942.C: New test.
......
// PR c++/85015
// { dg-do compile { target c++11 } }
// { dg-options "" }
void
foo ()
{
int &&c = v + 1; // { dg-error "was not declared in this scope" }
struct S { // { dg-message "declared here" "" { target *-*-* } .-1 }
void bar () { int a[c]; } // { dg-error "use of local variable with automatic storage from containing function" }
} e;
}
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