aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/sfinae23.C
blob: 53ed51dd52f5d126d0323b39d118769331b0959c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/44969
// { dg-do compile { target c++11 } }

template<typename Tp, typename... Args>
  class mini_is_constructible
  {
    typedef char one;
    typedef struct { char arr[2]; } two;

    template<typename Tp1, typename... Args1>
      static decltype(Tp1(Args1()...), one())
      test(int);

    template<typename, typename...>
      static two test(...);

  public:
    static const bool value = sizeof(test<Tp, Args...>(0)) == 1;
  };

class A { };

int Test[mini_is_constructible<int, A, A>::value ? -1 : 1];