https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101443
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Reduced testcase for -O2: template <typename a> struct e { a c; }; template <typename d> struct f { void operator()(d g, d h) { g < h; } }; template <unsigned long, typename> struct n; template <long i, typename d> using j = typename n<i, d>::k; template <typename...> class ah {}; template <unsigned long i, typename ag, typename... l> struct n<i, ah<ag, l...>> : n<i - 1, ah<l...>> {}; template <typename ag, typename... l> struct n<0, ah<ag, l...>> { typedef ag k; }; template <int i, typename... ai> j<i, ah<ai...>> aj(ah<ai...>); template <typename m, int i> struct o { static bool am(int g, m h) { 0 < aj<i>(h) || o<m, 1>::am(g, h); return false; } }; template <typename... ap, typename... aq> void operator<(ah<ap...>, ah<aq...>) { using ar = o<ah<aq...>, 0>; ar::am; } template <typename... ai> ah<ai...> as(ai...); template <typename d> struct F { d operator*(); }; template <typename av> struct p { typedef F<av> ay; }; template <typename az, typename ba = f<az>> struct q { void operator[](az g) { typename p<e<az>>::ay i; bh()(g, (*i).c); } ba bh(); }; struct r { template <typename... bj> static int aj(bj... g) { auto a = as(g...); using bc = decltype(a); q<bc> b; b[a]; return 0; } template <typename... bj> static int bn(bj... g) { aj(g...); return 0; } }; int main() { r::bn(0, nullptr); } Even simpler testcase: decltype(nullptr) foo (); bool bar () { return 0 < foo () || foo () < 0; }