зеркало из https://github.com/microsoft/STL.git
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:
Родитель
35078f3921
Коммит
1fb487f20a
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче