summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/constexpr-lambda3.C
blob: 46ee84686b1679806b8b9ab60066a79b3d805130 (plain)
1
2
3
4
5
6
7
8
// { dg-options -std=c++1z }

constexpr auto add = [] (int n, int m) {
  auto L = [=] { return n; };
  auto R = [=] { return m; };
  return [=] { return L() + R(); };
};
static_assert(add(3, 4)() == 7, "");