| 1 |
// PR c++/49058 |
| 2 |
// This error is not subject to SFINAE because it doesn't happen in the |
| 3 |
// deduction context. |
| 4 |
// { dg-do compile { target c++11 } } |
| 5 |
// { dg-prune-output "note" } |
| 6 |
|
| 7 |
template<typename T> T val(); |
| 8 |
|
| 9 |
struct F1 |
| 10 |
{ |
| 11 |
void operator()(); |
| 12 |
}; |
| 13 |
|
| 14 |
template<typename F> |
| 15 |
struct Bind |
| 16 |
{ |
| 17 |
template<typename R |
| 18 |
= decltype( val<F>()( ) )> |
| 19 |
R f(); |
| 20 |
|
| 21 |
template<typename R |
| 22 |
= decltype( val<const F>()( ) )> // { dg-error "no match" } |
| 23 |
R f() const; |
| 24 |
}; |
| 25 |
|
| 26 |
int main() |
| 27 |
{ |
| 28 |
Bind<F1> b; |
| 29 |
} |