PR c++/81525 - broken handling of auto in generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / lambda-generic-const4.C
blob1cf8551881328865585edaf1ee63da0d0e891c17
1 // PR c++/81525
2 // { dg-do run { target c++14 } }
4 template <int i> struct A {
5   constexpr operator int () const { return i; }
6 };
7 template <int i> constexpr A<i> a = {};
9 template <typename F> void foo (F f) {
10   f (A<0>{});
12 template <typename T>
13 void bar (T) {
14   constexpr auto N = a<1>;
15   auto f = [&] (auto i) {
16     if (static_cast<int>(N) != 1) __builtin_abort();
17   };
18   foo (f);
20 int main () { bar (0); }