diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-08-28 22:40:34 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-08-28 22:40:34 +0000 |
commit | 1ca66f7efec0dd2977b190a11f5ce8642a1e90b2 (patch) | |
tree | 41777c2f01235f1edc02affaed8dd5c2c337c778 /gcc | |
parent | b208ba405685dc77a095a22db323323abb3bf846 (diff) | |
download | gcc-1ca66f7efec0dd2977b190a11f5ce8642a1e90b2.zip gcc-1ca66f7efec0dd2977b190a11f5ce8642a1e90b2.tar.gz gcc-1ca66f7efec0dd2977b190a11f5ce8642a1e90b2.tar.bz2 |
re PR c++/58255 ([C++11] explicit delegating constructor with no arguments wrongly rejected)
/cp
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.
/testsuite
2013-08-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58255
* g++.dg/cpp0x/dc7.C: New.
From-SVN: r202061
Diffstat (limited to 'gcc')
-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() { } +}; |