mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 20:01:31 -05:00
* g++.dg/*.C: Use target c++17 instead of explicit dg-options. * lib/g++-dg.exp: Don't test C++11 by default. Add C++17 to the list of default stds to test. From-SVN: r265343
12 lines
454 B
C
12 lines
454 B
C
// Testcase from P0170R1
|
|
// { dg-do compile { target c++17 } }
|
|
|
|
// 'v' & 'm' are odr-used but do not occur in a constant-expression within the nested
|
|
// lambda, so are well-formed.
|
|
auto monad = [](auto v) { return [=] { return v; }; };
|
|
auto bind = [](auto m) {
|
|
return [=](auto fvm) { return fvm(m()); };
|
|
};
|
|
// OK to have captures to automatic objects created during constant expression evaluation.
|
|
static_assert(bind(monad(2))(monad)() == monad(2)());
|