From: Nathan Sidwell Date: Mon, 2 Nov 2020 16:54:16 +0000 (-0800) Subject: c++: Some additional tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a07912f2d1f73f298d93dcd27bd8fbe84427106;p=gcc.git 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. --- 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 ();