re PR c++/58871 ([c++11] ICE with defaulted copy constructor in broken template class...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 3 Feb 2014 18:22:46 +0000 (18:22 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 3 Feb 2014 18:22:46 +0000 (18:22 +0000)
/cp
2014-02-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58871
* method.c (synthesized_method_walk): If vbases is non-null but
is_empty is true, likewise don't worry about the virtual bases.

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

PR c++/58871
* g++.dg/cpp0x/pr58871.C: New.

From-SVN: r207434

gcc/cp/ChangeLog
gcc/cp/method.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr58871.C [new file with mode: 0644]

index 2e09c88..e73246a 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58871
+       * method.c (synthesized_method_walk): If vbases is non-null but
+       is_empty is true, likewise don't worry about the virtual bases.
+
 2014-02-01  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/51219
index a1a1051..b1fa943 100644 (file)
@@ -1366,7 +1366,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
     }
 
   vbases = CLASSTYPE_VBASECLASSES (ctype);
-  if (vbases == NULL)
+  if (vec_safe_is_empty (vbases))
     /* No virtual bases to worry about.  */;
   else if (!assign_p)
     {
index d896017..8c7af49 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58871
+       * g++.dg/cpp0x/pr58871.C: New.
+
 2014-02-03  Cong Hou  <congh@google.com>
 
        PR tree-optimization/60000
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr58871.C b/gcc/testsuite/g++.dg/cpp0x/pr58871.C
new file mode 100644 (file)
index 0000000..5920f5c
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/59111
+// { dg-do compile { target c++11 } }
+
+template<typename T> struct A : virtual T  // { dg-error "base type" }
+{
+  A();
+  A(const A&);
+};
+
+template<typename T> A<T>::A(const A<T>&) = default;
+
+A<int> a = A<int>();