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.
--- /dev/null
+// 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;
+}