Commit 66403b38 by Paolo Carlini Committed by Paolo Carlini

re PR c++/51431 (ICE with invalid use of abstract class)

/cp
2011-12-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51431
	* init.c (build_value_init): Check build_aggr_init_expr return
	value for error_mark_node.

/testsuite
2011-12-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51431
	* g++.dg/other/abstract3.C: New.

From-SVN: r182055
parent 62b547b5
2011-12-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51431
* init.c (build_value_init): Check build_aggr_init_expr return
value for error_mark_node.
2011-12-06 Dodji Seketeli <dodji@redhat.com> 2011-12-06 Dodji Seketeli <dodji@redhat.com>
PR c++/51427 PR c++/51427
......
...@@ -359,11 +359,9 @@ build_value_init (tree type, tsubst_flags_t complain) ...@@ -359,11 +359,9 @@ build_value_init (tree type, tsubst_flags_t complain)
tree ctor = build_special_member_call tree ctor = build_special_member_call
(NULL_TREE, complete_ctor_identifier, (NULL_TREE, complete_ctor_identifier,
NULL, type, LOOKUP_NORMAL, complain); NULL, type, LOOKUP_NORMAL, complain);
ctor = build_aggr_init_expr (type, ctor, complain);
if (ctor != error_mark_node) if (ctor != error_mark_node)
{ AGGR_INIT_ZERO_FIRST (ctor) = 1;
ctor = build_aggr_init_expr (type, ctor, complain);
AGGR_INIT_ZERO_FIRST (ctor) = 1;
}
return ctor; return ctor;
} }
} }
......
2011-12-06 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51431
* g++.dg/other/abstract3.C: New.
2011-12-06 Richard Guenther <rguenther@suse.de> 2011-12-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49997 PR tree-optimization/49997
......
// PR c++/51431
struct A // { dg-message "note" }
{
virtual void foo() = 0; // { dg-message "note" }
};
struct B
{
A a; // { dg-error "abstract" }
B() : a() {} // { dg-error "abstract" }
};
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