From f7d9ed11b28023715dfc10f29754beff86b28fe9 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 27 Mar 2018 21:19:25 +0000 Subject: [PATCH] re PR c++/85067 (ICE with volatile parameter in defaulted copy-constructor) /cp 2018-03-27 Paolo Carlini PR c++/85067 * method.c (defaulted_late_check): Partially revert r253321 changes, do not early return upon error. /testsuite 2018-03-27 Paolo Carlini PR c++/85067 * g++.dg/cpp0x/defaulted51.C: New. * g++.dg/cpp0x/constexpr-68754.C: Adjust. From-SVN: r258904 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/method.c | 1 - gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C | 2 +- gcc/testsuite/g++.dg/cpp0x/defaulted51.C | 15 +++++++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/defaulted51.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1799d8a9b14..4c029815b13 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-03-27 Paolo Carlini + + PR c++/85067 + * method.c (defaulted_late_check): Partially revert r253321 changes, + do not early return upon error. + 2018-03-27 Jakub Jelinek PR c++/85077 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 83fed6c8669..eaa930f7c58 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ba8ba77c42c..4c2298024c2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-03-27 Paolo Carlini + + PR c++/85067 + * g++.dg/cpp0x/defaulted51.C: New. + * g++.dg/cpp0x/constexpr-68754.C: Adjust. + 2018-03-27 Jakub Jelinek PR c++/85077 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C index 643fa078412..72b8200587e 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C @@ -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 index 00000000000..0a7d308707c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/defaulted51.C @@ -0,0 +1,15 @@ +// PR c++/85067 +// { dg-do compile { target c++11 } } + +template struct A +{ + A(); + A(volatile A&) = default; // { dg-error "defaulted" } +}; + +struct B +{ + A<0> a; +}; + +B b; -- 2.30.2