Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/cpp1z/constexpr-if26.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-if26.C Thu Feb 13 11:34:05 2020 +0900 @@ -0,0 +1,28 @@ +// 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; + }); +}