aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const2.C
blob: 884163a291ea1d20086197ed2ebe787f57a3852a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// PR c++/52026
// { dg-options "-O" }
// { dg-do run { target c++11 } }

template<bool B>
int func() {
  const int constVal1 = B ? 100 : -100;
  const int constVal = constVal1;
  return [] { return constVal; }();
}

int main() {
  if (func<true>() != 100)
    __builtin_abort ();
}