| 1 |
// PR c++/61636 |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
// permissiveness doesn't make this permitted |
| 4 |
// { dg-additional-options "-fpermissive" } |
| 5 |
|
| 6 |
// ICE because we attempt to use dependent Foo during error recovery |
| 7 |
// and die with an unexpected this capture need. |
| 8 |
|
| 9 |
template <typename T> struct Base |
| 10 |
{ |
| 11 |
void Foo (int); |
| 12 |
}; |
| 13 |
|
| 14 |
template <typename T> struct A : Base<T> { |
| 15 |
void b (); |
| 16 |
}; |
| 17 |
|
| 18 |
template <typename T> void A<T>::b() { |
| 19 |
|
| 20 |
auto lam = [&](auto asdf) { Foo (asdf); }; // { dg-error "not declared" } |
| 21 |
|
| 22 |
lam (T(0)); |
| 23 |
} |
| 24 |
|
| 25 |
template void A<int>::b (); |