Hi,
thus I tried to have a look to this issue, while experiencing some weird
problems with the debugger, which slowed me down a lot. I have been able
to figure out that we don't seem to actively set constexpr_p to true
anywhere in implicitly_declare_fn (besides the unrelated case of
inheriting constructors), thus I'm wondering if it would make sense to
simply do the below?!? (and revert my recent tweak)
Otherwise, Jason, if you suspect something deeper is going on, I would
rather ask you to take over, today the debugger is still misbehaving on
me :(
Thanks!
Paolo.
//////////////////////////
Index: cp/method.c
===================================================================
--- cp/method.c (revision 207457)
+++ cp/method.c (working copy)
@@ -1366,7 +1366,7 @@ synthesized_method_walk (tree ctype, special_funct
}
vbases = CLASSTYPE_VBASECLASSES (ctype);
- if (vec_safe_is_empty (vbases))
+ if (vbases == NULL)
/* No virtual bases to worry about. */;
else if (!assign_p)
{
@@ -1660,7 +1660,7 @@ implicitly_declare_fn (special_function_kind kind,
else if (trivial_p && cxx_dialect >= cxx11
&& (kind == sfk_copy_constructor
|| kind == sfk_move_constructor))
- gcc_assert (constexpr_p);
+ constexpr_p = true;
if (!trivial_p && type_has_trivial_fn (type, kind))
type_set_nontrivial_flag (type, kind);
Index: testsuite/g++.dg/cpp0x/pr60047.C
===================================================================
--- testsuite/g++.dg/cpp0x/pr60047.C (revision 0)
+++ testsuite/g++.dg/cpp0x/pr60047.C (working copy)
@@ -0,0 +1,14 @@
+// PR c++/60047
+// { dg-do compile { target c++11 } }
+
+struct B { };
+
+template<typename T> struct A : virtual B
+{
+ A();
+ A(const A&);
+};
+
+template<typename T> A<T>::A(const A<T>&) = default;
+
+A<int> a = A<int>();