gcc/testsuite/g++.dg/cpp1z/constexpr-lambda28.C
raw| 1 | // PR c++/107280 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | struct string { |
| 5 | char str[8] = ""; |
| 6 | }; |
| 7 | template <int, int> constexpr void |
| 8 | test () |
| 9 | { |
| 10 | string str{}; |
| 11 | auto append = [&](const char *s) { *str.str = *s; }; |
| 12 | append(""); |
| 13 | } |
| 14 | |
| 15 | static_assert ((test<true, true>(), true), ""); |