-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Unexpected behavior in deduction of nested templates with template template parameters (inconsistent with GCC, MSVC) #81577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-frontend Author: None (13steinj)
I don't have enough practice with standard-ese to express myself any better than that, unfortunately. Define `EVEN_WORSE` or `ALTERNATIVE_EVEN_WORSE` for a different, but seemingly related, inconsistency. Define `FIXED` to fix the original issue, and "fix" the "even worse" inconsistencies (successful compile, unexpectedly).
I'm happy to provide the motivating example, it's just larger. A whole load of transitional layers from one set of types to another. <details> template<typename>
struct Wrapper;
template<template<typename> typename, typename T>
using ComposedWrapper = Wrapper<T>;
template<typename...>
struct mp_list;
template<typename>
struct converter_impl;
template<typename T>
using converter = converter_impl<T>::type;
template<
#if !defined(EVEN_WORSE)
template<typename> typename Wrapper,
#endif
typename T
>
struct converter_impl<mp_list<Wrapper<T>>> {
using type = void;
};
template<typename T>
struct converter_impl<ComposedWrapper<Wrapper, T>> {
using type = converter<T>;
};
#if defined(__clang__) && defined(FIXED)
template<typename T>
struct converter_impl<ComposedWrapper<Wrapper, mp_list<T>>> {
using type = int;
};
#endif
template<typename>
concept valid = true;
static_assert(valid<converter<ComposedWrapper<Wrapper,
#if !defined(ALTERNATIVE_EVEN_WORSE)
mp_list<
#endif
mp_list<int>
#if !defined(ALTERNATIVE_EVEN_WORSE)
>
#endif
>>>); </details> |
This might be a variation of #65843 |
I believe this is IFNDR, it depends on how aggressively the compiler instantiates and I believe is allowed to be more aggressive here. Also see: #59966 (comment) |
I'm a bit confused in that the issue appears to be related to incomplete types. Yes, I'm using some incomplete types here, but this is just the reduced example. The larger example the types used in |
I don't have enough practice with standard-ese to express myself any better than that, unfortunately. Define
EVEN_WORSE
orALTERNATIVE_EVEN_WORSE
for a different, but seemingly related, inconsistency. DefineFIXED
to fix the original issue, and "fix" the "even worse" inconsistencies (successful compile, unexpectedly).I'm happy to provide the motivating example, it's just larger. A whole load of transitional layers from one set of types to another.
Reduced Example
The text was updated successfully, but these errors were encountered: