public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-799] testsuite: Add testcase for already fixed PR [PR90019]
@ 2021-05-14 12:58 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-05-14 12:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d25809dbfe43917b3bed9454620fcc24f04c1e03

commit r12-799-gd25809dbfe43917b3bed9454620fcc24f04c1e03
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri May 14 14:56:28 2021 +0200

    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.

Diff:
---
 gcc/testsuite/g++.dg/cpp0x/sfinae68.C | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae68.C b/gcc/testsuite/g++.dg/cpp0x/sfinae68.C
new file mode 100644
index 00000000000..d292b68bff6
--- /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>();
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-14 12:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 12:58 [gcc r12-799] testsuite: Add testcase for already fixed PR [PR90019] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).