Fix ill-formed primary template in P0896R4_ranges_subrange (#3120)

* Fix ill-formed primary template in P0896R4_ranges_subrange

The intent is that `illformed<T>()` be ill-formed so the primary `kind_of` template fails instantiation, but unfortunately it's ill-formed with no diagnostic required since no specialization of this template could be valid. (Unqualified lookup for `illformed` finds nothing, and ADL can find nothing since there are no arguments and therefore no associated namespaces.)

Reported internally by the FE team.

Mirrors the STL changes in MSVC-PR-425776.
This commit is contained in:
Casey Carter 2022-09-27 12:36:06 -07:00 коммит произвёл GitHub
Родитель 35078f3921
Коммит 1fb487f20a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -807,7 +807,12 @@ namespace test_subrange {
inline constexpr bool is_subrange<subrange<I, S, K>> = true;
template <class T>
inline constexpr auto kind_of = illformed<T>();
struct illformed {
static_assert(always_false<T>);
};
template <class T>
inline constexpr auto kind_of = illformed<T>{};
template <class I, class S, subrange_kind K>
inline constexpr auto kind_of<subrange<I, S, K>> = K;