public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8830] c++: add fixed test [PR94231]
@ 2024-02-06 16:49 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2024-02-06 16:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1befe47f64bf0b964be90730e2cbef550cb6d2b7

commit r14-8830-g1befe47f64bf0b964be90730e2cbef550cb6d2b7
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Feb 6 11:44:44 2024 -0500

    c++: add fixed test [PR94231]
    
    I was suprised to find out that r14-8759 fixed this accepts-invalid.
    
    clang version 17.0.6 rejects the test as well; clang version 19.0.0git
    crashes for which I opened
    <https://github.com/llvm/llvm-project/issues/80869>.
    
            PR c++/94231
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/cpp0x/deleted17.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/cpp0x/deleted17.C | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp0x/deleted17.C b/gcc/testsuite/g++.dg/cpp0x/deleted17.C
new file mode 100644
index 000000000000..3bebe8811653
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/deleted17.C
@@ -0,0 +1,20 @@
+// PR c++/94231
+// { dg-do compile { target c++11 } }
+
+struct F {F(F&&)=delete;};
+
+template<int=0>
+struct M {
+  F f;
+  M();
+  M(const M&);
+  M(M&&);
+};
+
+template<int I>
+M<I>::M(M&&)=default; // { dg-error "use of deleted function" }
+
+M<> f() {
+  M<> m;
+  return m;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-06 16:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 16:49 [gcc r14-8830] c++: add fixed test [PR94231] Marek Polacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).