Files
gcc-reflection/gcc/testsuite/g++.dg/cpp1y/lambda-generic-const4a.C
Jason Merrill 6411847fcf PR c++/81525 - broken handling of auto in generic lambda.
* pt.c (tsubst_decl) [VAR_DECL]: Use strip_innermost_template_args.

From-SVN: r253414
2017-10-04 11:37:09 -04:00

21 lines
416 B
C

// PR c++/81525
// { dg-do run { target c++14 } }
template <int i> struct A {
constexpr operator int () const { return i; }
};
template <int i> constexpr A<i> a = {};
template <typename F> void foo (F f) {
f (42);
}
template <typename T>
void bar (T) {
constexpr auto N = a<1>;
auto f = [&] (auto i) {
if (static_cast<decltype(i)>(N) != 1) __builtin_abort();
};
foo (f);
}
int main () { bar (0); }