// PR c++/112288 // { dg-do compile { target c++11 } } template struct slot { template friend constexpr bool slot_allocated(slot, U); }; template struct allocate_slot { template friend constexpr bool slot_allocated(slot, U) { return true; } }; template{}, 42)> constexpr int next(int) { return 1; } template constexpr int next(...) { return (allocate_slot{}, 0); } // slot_allocated, int>() not defined yet static_assert(next(0) == 0, ""); // now it's defined, need to make existing spec point to defn or else ICE static_assert(next(0) == 1, "");