Commit 6cfbc023 by Paolo Carlini Committed by Paolo Carlini

re PR c++/60047 (ICE with defaulted copy constructor and virtual base class)

/cp
2014-02-12  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60047
	* method.c (implicitly_declare_fn): A constructor of a class with
	virtual base classes isn't constexpr (7.1.5p4).

/testsuite
2014-02-12  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60047
	* g++.dg/cpp0x/pr60047.C: New.

From-SVN: r207712
parent c2bf53a1
2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60047
* method.c (implicitly_declare_fn): A constructor of a class with
virtual base classes isn't constexpr (7.1.5p4).
2014-02-05 Jan Hubicka <hubicka@ucw.cz 2014-02-05 Jan Hubicka <hubicka@ucw.cz
* parser.c (synthesize_implicit_template_parm): Use grow_tree_vec. * parser.c (synthesize_implicit_template_parm): Use grow_tree_vec.
......
...@@ -1656,10 +1656,12 @@ implicitly_declare_fn (special_function_kind kind, tree type, ...@@ -1656,10 +1656,12 @@ implicitly_declare_fn (special_function_kind kind, tree type,
/* Don't bother marking a deleted constructor as constexpr. */ /* Don't bother marking a deleted constructor as constexpr. */
if (deleted_p) if (deleted_p)
constexpr_p = false; constexpr_p = false;
/* A trivial copy/move constructor is also a constexpr constructor. */ /* A trivial copy/move constructor is also a constexpr constructor,
unless the class has virtual bases (7.1.5p4). */
else if (trivial_p && cxx_dialect >= cxx11 else if (trivial_p && cxx_dialect >= cxx11
&& (kind == sfk_copy_constructor && (kind == sfk_copy_constructor
|| kind == sfk_move_constructor)) || kind == sfk_move_constructor)
&& !CLASSTYPE_VBASECLASSES (type))
gcc_assert (constexpr_p); gcc_assert (constexpr_p);
if (!trivial_p && type_has_trivial_fn (type, kind)) if (!trivial_p && type_has_trivial_fn (type, kind))
......
2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60047
* g++.dg/cpp0x/pr60047.C: New.
2014-02-12 Jakub Jelinek <jakub@redhat.com> 2014-02-12 Jakub Jelinek <jakub@redhat.com>
PR c/60101 PR c/60101
......
// 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>();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment