* parser.c (cp_parser_late_parse_one_default_arg): Set
TARGET_EXPR_DIRECT_INIT_P.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204263
138bc75d-0d04-0410-961f-
82ee72b054a4
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.
&& 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;
}
}
--- /dev/null
+// PR c++/58162
+// { dg-require-effective-target c++11 }
+
+struct A {
+ A();
+ A(A&&);
+};
+
+struct B {
+ A const a = A();
+};
+
+B b;