1 // PR c++/81525 2 // { dg-do run { target c++14 } } 3 4 template <int i> struct A { 5 constexpr operator int () const { return i; } 6 }; 7 template <int i> constexpr A<i> a = {}; 8 foo(F f)9template <typename F> void foo (F f) { 10 f (42); 11 } 12 template <typename T> bar(T)13void bar (T) { 14 constexpr auto N = a<1>; 15 auto f = [&] (auto i) { 16 if (static_cast<decltype(i)>(N) != 1) __builtin_abort(); 17 }; 18 foo (f); 19 } main()20int main () { bar (0); } 21