re PR c++/70563 (SFINAE fails when trying invalid template instantiation)
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / sfinae62.C
blob7bde64c9f4dd91ef3386034c413ec62dd7d64d3f
1 // PR c++/70563
2 // { dg-do compile { target c++11 } }
4 template<typename... T> using void_t = void;
6 template<typename T> struct TemporaryBindObject
8 };
10 struct MyTrueType
12  static constexpr bool value = true;
15 struct MyFalseType
17  static constexpr bool value = false;
20 template<template<typename...> class Dest> struct TestValidBind
22  template<typename T, typename = void_t<>> struct toTypesOf : MyFalseType
23  {};
24  template<template<typename...> class Src, typename... Ts> struct toTypesOf<Src<Ts...>, void_t<Dest<Ts...,float>>> : MyTrueType
25  {};
28 template<typename T> struct OneParamStruct
31 template<typename T1, typename T2> struct TwoParamStruct
35 using tmp = TemporaryBindObject<int>;
37 int main()
39  bool value1 = TestValidBind<TwoParamStruct>::toTypesOf<TemporaryBindObject<int>>::value;
40  bool value2 = TestValidBind<OneParamStruct>::toTypesOf<TemporaryBindObject<int>>::value;