view gcc/testsuite/g++.dg/cpp2a/lambda-generic6.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

// P0428R2
// { dg-do compile { target c++14 } }

struct S { int s; };

auto x =
#if __cpp_generic_lambdas >= 201707
  []<class T = S>(T &&t) { return t.s; } ({ 2 });
#else
  [](auto &&t) { return t.s; } (S { 2 });
#endif