1 // PR c++/86740 2 // { dg-do compile { target c++17 } } 3 4 struct Constant 5 { 6 static constexpr int value = 0; 7 }; 8 template<typename F> invokeWithConstant(F && f)9void invokeWithConstant(F &&f) 10 { 11 f(Constant{}); 12 } foo()13int foo() 14 { 15 int count = 0; 16 invokeWithConstant 17 ([&] (auto id1) 18 { 19 invokeWithConstant 20 ([&] (auto id2) 21 { 22 if constexpr (id1.value == 0 && id2.value == 0) 23 [&] { count = 1; } (); 24 }); 25 }); 26 return count; 27 } 28