Commit 8c8f2ab7 by Marek Polacek Committed by Marek Polacek

re PR c++/84663 (internal compiler error: tree check: expected array_type, have…

re PR c++/84663 (internal compiler error: tree check: expected array_type, have error_mark in cp_complete_array_type, at cp/decl.c:8334)

	PR c++/84663
	* decl.c (cp_complete_array_type): Check error_mark_node.

	* g++.dg/parse/array-size3.C: New test.

From-SVN: r258148
parent 0805d020
2018-03-02 Marek Polacek <polacek@redhat.com>
PR c++/84663
* decl.c (cp_complete_array_type): Check error_mark_node.
2018-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/84662
......
......@@ -8323,7 +8323,7 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
bits. See also complete_type which does the same thing for arrays
of fixed size. */
type = *ptype;
if (TYPE_DOMAIN (type))
if (type != error_mark_node && TYPE_DOMAIN (type))
{
elt_type = TREE_TYPE (type);
TYPE_NEEDS_CONSTRUCTING (type) = TYPE_NEEDS_CONSTRUCTING (elt_type);
......
......@@ -3,6 +3,9 @@
PR c++/84171
* g++.dg/warn/Wsign-compare-8.C: New test.
PR c++/84663
* g++.dg/parse/array-size3.C: New test.
2018-03-02 Jakub Jelinek <jakub@redhat.com>
PR c++/84662
......
// PR c++/84663
struct S {
typedef S T[8];
int f : -1ULL; // { dg-warning "exceeds its type" }
S () { struct { T d; } e[]; } // { dg-error "size" }
};
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