re PR c++/85067 (ICE with volatile parameter in defaulted copy-constructor)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 27 Mar 2018 21:19:25 +0000 (21:19 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 27 Mar 2018 21:19:25 +0000 (21:19 +0000)
/cp
2018-03-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/85067
* method.c (defaulted_late_check): Partially revert r253321 changes,
do not early return upon error.

/testsuite
2018-03-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/85067
* g++.dg/cpp0x/defaulted51.C: New.
* g++.dg/cpp0x/constexpr-68754.C: Adjust.

From-SVN: r258904

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

index 1799d8a9b146b50fa783b84d81dc62c5b7dff2f1..4c029815b138fb777a6c52c2252f818344ebaf10 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/85067
+       * method.c (defaulted_late_check): Partially revert r253321 changes,
+       do not early return upon error.
+
 2018-03-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/85077
index 83fed6c86691fd5a7d6d8bbab4769b9447a8aa98..eaa930f7c58e0f18dae7459aadbb42e7cff99e1a 100644 (file)
@@ -2189,7 +2189,6 @@ defaulted_late_check (tree fn)
             "expected signature", fn);
       inform (DECL_SOURCE_LOCATION (fn),
              "expected signature: %qD", implicit_fn);
-      return;
     }
 
   if (DECL_DELETED_FN (implicit_fn))
index ba8ba77c42c73a504fae03ef4556efb15bb02810..4c2298024c27c4292b82da531499fdd701260f2e 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/85067
+       * g++.dg/cpp0x/defaulted51.C: New.
+       * g++.dg/cpp0x/constexpr-68754.C: Adjust.
+
 2018-03-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/85077
index 643fa07841218155f60ed206920ffba8ade51a0e..72b8200587e5218621b6a669ddc2d2f73107be99 100644 (file)
@@ -3,5 +3,5 @@
 
 struct base { };
 struct derived : base {
-  constexpr derived& operator=(derived const&) = default; // { dg-error "defaulted declaration" "" { target { ! c++14 } } }
+  constexpr derived& operator=(derived const&) = default; // { dg-error "defaulted" "" { target { ! c++14 } } }
 };
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted51.C b/gcc/testsuite/g++.dg/cpp0x/defaulted51.C
new file mode 100644 (file)
index 0000000..0a7d308
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/85067
+// { dg-do compile { target c++11 } }
+
+template<int> struct A
+{
+  A();
+  A(volatile A&) = default;  // { dg-error "defaulted" }
+};
+
+struct B
+{
+  A<0> a;
+};
+
+B b;