diff options
author | Jason Merrill <jason@redhat.com> | 2013-10-31 10:41:55 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-10-31 10:41:55 -0400 |
commit | 1c79ebd52214a424949c5a242ee440f211bc9566 (patch) | |
tree | d67f20fcb9ac8a488600717ca6f7a0999407871e | |
parent | 83f31d8d5d6e738a2a1b844acd992e18cdd328d1 (diff) | |
download | gcc-1c79ebd52214a424949c5a242ee440f211bc9566.zip gcc-1c79ebd52214a424949c5a242ee440f211bc9566.tar.gz gcc-1c79ebd52214a424949c5a242ee440f211bc9566.tar.bz2 |
re PR c++/58162 ([C++11] bogus error: use of deleted function 'constexpr A::A(const A&)')
PR c++/58162
* parser.c (cp_parser_late_parse_one_default_arg): Set
TARGET_EXPR_DIRECT_INIT_P.
From-SVN: r204263
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/parser.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/nsdmi9.C | 13 |
3 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a0d802f..3410153 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2013-10-31 Jason Merrill <jason@redhat.com> + PR c++/58162 + * parser.c (cp_parser_late_parse_one_default_arg): Set + TARGET_EXPR_DIRECT_INIT_P. + * class.c (type_build_ctor_call): Return early in C++98 mode. (type_build_dtor_call): Likewise. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 9e28ced..bbc8e75 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -23212,6 +23212,9 @@ cp_parser_late_parse_one_default_arg (cp_parser *parser, tree decl, && CONSTRUCTOR_IS_DIRECT_INIT (parsed_arg)) flags = LOOKUP_NORMAL; parsed_arg = digest_init_flags (TREE_TYPE (decl), parsed_arg, flags); + if (TREE_CODE (parsed_arg) == TARGET_EXPR) + /* This represents the whole initialization. */ + TARGET_EXPR_DIRECT_INIT_P (parsed_arg) = true; } } diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi9.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi9.C new file mode 100644 index 0000000..febe0ec --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi9.C @@ -0,0 +1,13 @@ +// PR c++/58162 +// { dg-require-effective-target c++11 } + +struct A { + A(); + A(A&&); +}; + +struct B { + A const a = A(); +}; + +B b; |