From: Paolo Carlini Date: Tue, 8 May 2018 10:03:39 +0000 (+0000) Subject: re PR c++/70563 (SFINAE fails when trying invalid template instantiation) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4430130d282ddb77373e716376b66bf4c007bbfa;p=gcc.git re PR c++/70563 (SFINAE fails when trying invalid template instantiation) 2018-05-08 Paolo Carlini PR c++/70563 * g++.dg/cpp0x/sfinae62.C: New. From-SVN: r260030 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc61ffb938e..d5126b3eb6d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-05-08 Paolo Carlini + + PR c++/70563 + * g++.dg/cpp0x/sfinae62.C: New. + 2018-05-08 Richard Sandiford * gcc.target/aarch64/sve/vcond_6.c (LOOP): Unconditionally diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae62.C b/gcc/testsuite/g++.dg/cpp0x/sfinae62.C new file mode 100644 index 00000000000..7bde64c9f4d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae62.C @@ -0,0 +1,41 @@ +// PR c++/70563 +// { dg-do compile { target c++11 } } + +template using void_t = void; + +template struct TemporaryBindObject +{ +}; + +struct MyTrueType +{ + static constexpr bool value = true; +}; + +struct MyFalseType +{ + static constexpr bool value = false; +}; + +template class Dest> struct TestValidBind +{ + template> struct toTypesOf : MyFalseType + {}; + template class Src, typename... Ts> struct toTypesOf, void_t>> : MyTrueType + {}; +}; + +template struct OneParamStruct +{ +}; +template struct TwoParamStruct +{ +}; + +using tmp = TemporaryBindObject; + +int main() +{ + bool value1 = TestValidBind::toTypesOf>::value; + bool value2 = TestValidBind::toTypesOf>::value; +}