aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-05-14 14:56:28 +0200
committerJakub Jelinek <jakub@redhat.com>2021-05-14 14:56:28 +0200
commitd25809dbfe43917b3bed9454620fcc24f04c1e03 (patch)
tree3dc9214a4344d15a19b0e2c111bd56ababa4a1be /gcc
parentcb787efa45782adab764575a2efc356e082828b6 (diff)
downloadgcc-d25809dbfe43917b3bed9454620fcc24f04c1e03.zip
gcc-d25809dbfe43917b3bed9454620fcc24f04c1e03.tar.gz
gcc-d25809dbfe43917b3bed9454620fcc24f04c1e03.tar.bz2
testsuite: Add testcase for already fixed PR [PR90019]
2021-05-14 Jakub Jelinek <jakub@redhat.com> PR c++/90019 * g++.dg/cpp0x/sfinae68.C: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/sfinae68.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae68.C b/gcc/testsuite/g++.dg/cpp0x/sfinae68.C
new file mode 100644
index 0000000..d292b68
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae68.C
@@ -0,0 +1,23 @@
+// PR c++/90019
+// { dg-do compile { target c++11 } }
+
+template<bool, typename T = void>
+struct enable_if { };
+template<typename T>
+struct enable_if<true, T> { typedef T type; };
+template<bool C, typename T = void>
+using __enable_if_t = typename enable_if<C, T>::type;
+template<bool C, typename T = void>
+using enable_if_t = typename enable_if<C, T>::type;
+
+template <int I, enable_if_t<I == 0, int>...> void foo() {}
+template <int I, enable_if_t<I != 0, int>...> void foo() {}
+template <int I, int=0, enable_if_t<I == 0, int>...> void bar() {}
+template <int I, int=0, enable_if_t<I != 0, int>...> void bar() {}
+
+void test()
+{
+ bar<0>();
+ bar<0,0>();
+ foo<0>();
+}