view gcc/testsuite/g++.dg/cpp1z/constexpr-if26.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

// PR c++/88752
// { dg-do compile { target c++17 } }

template <int a> struct b { static constexpr int c = a; };
class d;
template <typename> struct e { typedef d f; };
template <typename g> using h = typename e<g>::f;
template <typename> constexpr bool i = b<true>::c;
class d {
public:
  using j = float;
};
template <typename> void k();
int main() { k<d>(); }
template <class l> l m;
template <class, class r> void n(r o) {
  [](int) {}(o(m<d>));
}
template <typename> void k() {
  n<int>([](auto inputs) {
    auto p(inputs);
    using s = h<decltype(p)>;
    s q;
    if constexpr (i<typename s::j>)
      [&] { return q; }();
    return 42;
  });
}