summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/sfinae15.C
blob: 27bce255db37c71bfccae89b7ec346f1e56d97c1 (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++/40944
// { dg-options -std=c++0x }
// { dg-do run }

template<typename T>
struct make { static T&& it(); };

void (*pf)(int&) = 0;

template< typename T >
int bar(T const& x,
        decltype( pf(make<T const&>::it()) )* = 0 // SFINAE!
        ) {
    return 1;
}

int bar(...) {
    return 0;
}

int main() {
    return bar(42);
}