diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-30 17:00:32 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-30 17:00:32 +0000 |
commit | a9d3f824d4f741fa4195bd34335d00a5b0ba2820 (patch) | |
tree | 4563be93ea2887cfdfbf160bdea3cacbdca47b12 | |
parent | 77e8366a8d3a72f6b1e71c75058cdd6d908b288b (diff) | |
download | gcc-a9d3f824d4f741fa4195bd34335d00a5b0ba2820.tar.gz |
/cp
2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/68754
* method.c (defaulted_late_check): Early return if the defaulted
declaration does not match the expected signature.
/testsuite
2017-09-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/68754
* g++.dg/cpp1y/constexpr-68754.C: Move...
* g++.dg/cpp0x/constexpr-68754.C: ... here, adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253321 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/method.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/constexpr-68754.C | 7 |
5 files changed, 24 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a9ee9a5eacf..4025cb09fb4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-09-30 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/68754 + * method.c (defaulted_late_check): Early return if the defaulted + declaration does not match the expected signature. + 2017-09-29 Jakub Jelinek <jakub@redhat.com> P0683R1 - default member initializers for bit-fields diff --git a/gcc/cp/method.c b/gcc/cp/method.c index b83a6f2d10d..7788afba48b 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -2191,9 +2191,11 @@ defaulted_late_check (tree fn) || !compparms (TYPE_ARG_TYPES (TREE_TYPE (fn)), TYPE_ARG_TYPES (TREE_TYPE (implicit_fn)))) { - error ("defaulted declaration %q+D", fn); - error_at (DECL_SOURCE_LOCATION (fn), - "does not match expected signature %qD", implicit_fn); + error ("defaulted declaration %q+D does not match the " + "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 ebcfb1b5181..cd4688e7916 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-09-30 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/68754 + * g++.dg/cpp1y/constexpr-68754.C: Move... + * g++.dg/cpp0x/constexpr-68754.C: ... here, adjust. + 2017-09-30 Jakub Jelinek <jakub@redhat.com> PR target/82361 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C new file mode 100644 index 00000000000..643fa078412 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-68754.C @@ -0,0 +1,7 @@ +// PR c++/68754 +// { dg-do compile { target c++11 } } + +struct base { }; +struct derived : base { + constexpr derived& operator=(derived const&) = default; // { dg-error "defaulted declaration" "" { target { ! c++14 } } } +}; diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-68754.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-68754.C deleted file mode 100644 index e72acb1baa3..00000000000 --- a/gcc/testsuite/g++.dg/cpp1y/constexpr-68754.C +++ /dev/null @@ -1,7 +0,0 @@ -// PR c++/68754 -// { dg-do compile { target c++14 } } - -struct base { }; -struct derived : base { - constexpr derived& operator=(derived const&) = default; -}; |