aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-11-02 08:54:16 -0800
committerNathan Sidwell <nathan@acm.org>2020-11-02 08:57:33 -0800
commit0a07912f2d1f73f298d93dcd27bd8fbe84427106 (patch)
tree2c247cc1490cfbb99ed59c6e3bddb1f6ad81a3ad
parent48a201e9bc8d9de74824ba335d910dfb98113866 (diff)
downloadgcc-0a07912f2d1f73f298d93dcd27bd8fbe84427106.zip
gcc-0a07912f2d1f73f298d93dcd27bd8fbe84427106.tar.gz
gcc-0a07912f2d1f73f298d93dcd27bd8fbe84427106.tar.bz2
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.
-rw-r--r--gcc/testsuite/g++.dg/concepts/pack-1.C31
-rw-r--r--gcc/testsuite/g++.dg/lookup/using53.C1
-rw-r--r--gcc/testsuite/g++.dg/template/error25.C2
3 files changed, 33 insertions, 1 deletions
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 0000000..b4f2c36
--- /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 <concepts>, via header units
+
+template<typename _ArgTypes>
+struct is_invocable;
+
+template<typename... _Args>
+concept invocable = is_invocable<_Args...>::value;
+
+template<typename _Is>
+requires invocable<_Is>
+class BUG;
+
+template<typename _Is>
+requires invocable<_Is>
+class BUG {}; // { dg-bogus "different constraints" }
+
+template<int> struct is_invocable_NT;
+
+template<int... Ints>
+concept invocable_NT = is_invocable_NT<Ints...>::value;
+
+template<int _Is>
+requires invocable_NT<_Is>
+class BUG_NT;
+
+template<int _Is>
+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 595612e..f9e59e6 100644
--- a/gcc/testsuite/g++.dg/lookup/using53.C
+++ b/gcc/testsuite/g++.dg/lookup/using53.C
@@ -43,6 +43,7 @@ template class DT<int>;
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 8901157..77b59cd 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<void> (); // { dg-error "explicit template specialization cannot have a storage class" }
-export template<class T> // { dg-warning "keyword 'export' not implemented" }
+export template<class T> // { dg-warning "keyword 'export'" }
static void* f3 ();