2 // { dg-do compile { target c++11 } }
7 friend constexpr bool slot_allocated(slot<T>, U);
11 struct allocate_slot {
13 friend constexpr bool slot_allocated(slot<T>, U) { return true; }
16 template<class T, bool = slot_allocated(slot<T>{}, 42)>
17 constexpr int next(int) { return 1; }
20 constexpr int next(...) { return (allocate_slot<T>{}, 0); }
22 // slot_allocated<slot<int>, int>() not defined yet
23 static_assert(next<int>(0) == 0, "");
24 // now it's defined, need to make existing spec point to defn or else ICE
25 static_assert(next<int>(0) == 1, "");