view gcc/testsuite/g++.dg/cpp1y/lambda-init1.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

// N3648: capture init
// { dg-options "-w" }
// { dg-do run { target c++14 } }

int main()
{
  int x = 41;
  auto r = [x = x+1]{ return x; }();
  if (r != 42) __builtin_abort();

  static auto *p = &r;
  [&x=r]{ if (&x != p) __builtin_abort(); }();
}