gcc/testsuite/g++.dg/cpp1z/constexpr-if20.C
raw| 1 | // PR c++/85214 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | struct g { |
| 5 | constexpr operator int() { return true; } |
| 6 | }; |
| 7 | template <typename T, typename U> constexpr bool m = true; |
| 8 | template <long L> struct C { typedef double q; }; |
| 9 | void ao() { |
| 10 | [](auto i) { |
| 11 | using ar = typename C<i>::q; |
| 12 | [](auto j) { |
| 13 | using as = typename C<j>::q; |
| 14 | if constexpr (m<ar, as>) {} |
| 15 | // { dg-bogus "'i' is not captured" "PR107437" { xfail { *-*-* } } .-1 } |
| 16 | }(g()); |
| 17 | }(g()); |
| 18 | } |