1 // PR c++/52026
2 // { dg-options "-O" }
3 // { dg-do run { target c++11 } }
4 
5 template<bool B>
func()6 int func() {
7   const int constVal1 = B ? 100 : -100;
8   const int constVal = constVal1;
9   return [] { return constVal; }();
10 }
11 
main()12 int main() {
13   if (func<true>() != 100)
14     __builtin_abort ();
15 }
16