From: Patrick Palka Date: Mon, 21 Feb 2022 14:20:23 +0000 (-0500) Subject: c++: Add testcase for already fixed PR [PR85493] X-Git-Tag: upstream/12.2.0~1386 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e74d764e172fa6afdbd194ce57decc80237631dc;p=platform%2Fupstream%2Fgcc.git c++: Add testcase for already fixed PR [PR85493] The a1 and a2 case were fixed (by diagnosing the invalid expression) with r11-434, and the a3 case with r8-7625. PR c++/85493 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/decltype80.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype80.C b/gcc/testsuite/g++.dg/cpp0x/decltype80.C new file mode 100644 index 0000000..6ad140f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype80.C @@ -0,0 +1,16 @@ +// PR c++/85493 +// { dg-do compile { target c++11 } } + +struct no_def { + no_def() = delete; +}; + +template +int foo() = delete; + +template +void test() { + decltype(no_def()) a1; // { dg-error "deleted" } + decltype(no_def(1,2,3)) a2; // { dg-error "no match" } + decltype(foo<>()) a3; // { dg-error "deleted" } +}