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.
This commit is contained in:
Marek Polacek 2024-02-06 11:44:44 -05:00
parent 8ec2f1922a
commit 1befe47f64

View file

@ -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;
}