aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae24.C
blob: 6d275d317be55006556f35fdee88ae40fedb8c8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR c++/49058
// This error is not subject to SFINAE because it doesn't happen in the
// deduction context.
// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }

template<typename T> T val();

struct F1
{
    void operator()();
};

template<typename F>
struct Bind
{
    template<typename R
      = decltype( val<F>()( ) )>
    R f();

    template<typename R
      = decltype( val<const F>()( ) )> // { dg-error "no match" }
    R f() const;
};

int main()
{
  Bind<F1> b;
}