From 0a07912f2d1f73f298d93dcd27bd8fbe84427106 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 2 Nov 2020 08:54:16 -0800 Subject: [PATCH] c++: Some additional tests I created a few tests on the modules branch that are not actually module-related. Here they are. gcc/testsuite/ * g++.dg/concepts/pack-1.C: New. * g++.dg/lookup/using53.C: Add an enum. * g++.dg/template/error25.C: Relax 'export' error check. --- gcc/testsuite/g++.dg/concepts/pack-1.C | 31 +++++++++++++++++++++++++ gcc/testsuite/g++.dg/lookup/using53.C | 1 + gcc/testsuite/g++.dg/template/error25.C | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/concepts/pack-1.C diff --git a/gcc/testsuite/g++.dg/concepts/pack-1.C b/gcc/testsuite/g++.dg/concepts/pack-1.C new file mode 100644 index 00000000000..b4f2c36374d --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/pack-1.C @@ -0,0 +1,31 @@ +// { dg-do compile { target c++17 } } +// { dg-options "-fconcepts" } + +// distilled from , via header units + +template +struct is_invocable; + +template +concept invocable = is_invocable<_Args...>::value; + +template +requires invocable<_Is> +class BUG; + +template +requires invocable<_Is> +class BUG {}; // { dg-bogus "different constraints" } + +template struct is_invocable_NT; + +template +concept invocable_NT = is_invocable_NT::value; + +template +requires invocable_NT<_Is> +class BUG_NT; + +template +requires invocable_NT<_Is> +class BUG_NT {}; diff --git a/gcc/testsuite/g++.dg/lookup/using53.C b/gcc/testsuite/g++.dg/lookup/using53.C index 595612e4efe..f9e59e66cea 100644 --- a/gcc/testsuite/g++.dg/lookup/using53.C +++ b/gcc/testsuite/g++.dg/lookup/using53.C @@ -43,6 +43,7 @@ template class DT; namespace N { int i; + enum bob {Q}; } void diff --git a/gcc/testsuite/g++.dg/template/error25.C b/gcc/testsuite/g++.dg/template/error25.C index 89011576e04..77b59cd7ca2 100644 --- a/gcc/testsuite/g++.dg/template/error25.C +++ b/gcc/testsuite/g++.dg/template/error25.C @@ -12,5 +12,5 @@ extern void f2 (); template<> extern void f2 (); // { dg-error "explicit template specialization cannot have a storage class" } -export template // { dg-warning "keyword 'export' not implemented" } +export template // { dg-warning "keyword 'export'" } static void* f3 (); -- 2.30.2