Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp1z/constexpr-if-lambda3.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
// PR c++/92583 // { dg-do compile { target c++17 } } template <int> struct a { constexpr operator int() { return 42; } }; template <typename> using b = int; template <typename d, d> struct e {}; template <typename d, d g> using h = e<d, __integer_pack(g)...>; template <typename j, typename k, k... index> void apply(j f, e<k, index...>) { (f(a<index>{}), ...); } template <auto l, typename j> void m(j f) { using k = b<decltype(l)>; using n = h<k, l>; apply(f, n{}); } template <int, int c> void o() { auto p = [](auto i) { if constexpr (a<i>{}) ; }; m<c>(p); } auto q() { o<0, 1>; }