Commit 1c682d06 by Fabien Chêne

Fix PR C++/48859

From-SVN: r173583
parent 03808d17
2011-05-07 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/48859
* init.c (diagnose_uninitialized_cst_or_ref_member_1): stop the
recursion if there is user defined constructor.
2011-05-09 Jason Merrill <jason@redhat.com> 2011-05-09 Jason Merrill <jason@redhat.com>
PR c++/34772 PR c++/34772
......
...@@ -1915,6 +1915,9 @@ diagnose_uninitialized_cst_or_ref_member_1 (tree type, tree origin, ...@@ -1915,6 +1915,9 @@ diagnose_uninitialized_cst_or_ref_member_1 (tree type, tree origin,
field_type = strip_array_types (TREE_TYPE (field)); field_type = strip_array_types (TREE_TYPE (field));
if (type_has_user_provided_constructor (field_type))
continue;
if (TREE_CODE (field_type) == REFERENCE_TYPE) if (TREE_CODE (field_type) == REFERENCE_TYPE)
{ {
++ error_count; ++ error_count;
......
2001-05-07 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/48859
* g++.dg/init/pr48859.C: New.
2011-05-09 Jason Merrill <jason@redhat.com> 2011-05-09 Jason Merrill <jason@redhat.com>
* gcc.dg/gcc.dg/uninit-D.c: Move to c-c++-common. * gcc.dg/gcc.dg/uninit-D.c: Move to c-c++-common.
......
// PR c++/48859
// { dg-do compile }
struct HasConstructor {
HasConstructor() {}
};
class ConstMember {
const HasConstructor empty_;
};
void foo() {
new ConstMember;
}
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