diff options
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/init.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/dc7.C | 7 |
4 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index da60378..bf49198 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-08-28 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/58255 + * init.c (build_aggr_init): When init == void_type_node do not + set LOOKUP_ONLYCONVERTING. + 2013-08-27 Caroline Tice <cmtice@google.com> * vtable-class-hierarchy.c: Remove unnecessary include statements. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 3ec32c5..156b4a1 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1464,7 +1464,8 @@ build_aggr_init (tree exp, tree init, int flags, tsubst_flags_t complain) TREE_READONLY (exp) = 0; TREE_THIS_VOLATILE (exp) = 0; - if (init && TREE_CODE (init) != TREE_LIST + if (init && init != void_type_node + && TREE_CODE (init) != TREE_LIST && !(TREE_CODE (init) == TARGET_EXPR && TARGET_EXPR_DIRECT_INIT_P (init)) && !(BRACE_ENCLOSED_INITIALIZER_P (init) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4e2daaf..afd5eaf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-08-28 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/58255 + * g++.dg/cpp0x/dc7.C: New. + 2013-08-28 Jakub Jelinek <jakub@redhat.com> PR middle-end/58257 diff --git a/gcc/testsuite/g++.dg/cpp0x/dc7.C b/gcc/testsuite/g++.dg/cpp0x/dc7.C new file mode 100644 index 0000000..e48741e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/dc7.C @@ -0,0 +1,7 @@ +// PR c++/58255 +// { dg-do compile { target c++11 } } + +struct A { + explicit A() { } + A(int x) : A() { } +}; |