diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-02-21 09:20:23 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-02-21 09:20:23 -0500 |
commit | e74d764e172fa6afdbd194ce57decc80237631dc (patch) | |
tree | 2e844e4014cd536efd9bf88844d65efbeb0cdcff | |
parent | d34cdec56728ddbdfacabd9f80598b17d1c6ff54 (diff) | |
download | gcc-e74d764e172fa6afdbd194ce57decc80237631dc.zip gcc-e74d764e172fa6afdbd194ce57decc80237631dc.tar.gz gcc-e74d764e172fa6afdbd194ce57decc80237631dc.tar.bz2 |
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.
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype80.C | 16 |
1 files changed, 16 insertions, 0 deletions
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<class...> +int foo() = delete; + +template<class> +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" } +} |