Skip to content

Conversation

localspook
Copy link

Now that the minimum clang version is 16 (#1657), the code can take advantage of implicit typename, right?

Copy link

copy-pr-bot bot commented Oct 3, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericniebler
Copy link
Collaborator

you would think, but i've seen msvc struggle without the typename. i'll run the tests to confirm, but i think this pr is premature.

@ericniebler
Copy link
Collaborator

/ok to test c246aa2

@localspook
Copy link
Author

localspook commented Oct 8, 2025

Now that's quite bizarre. This is the pattern that's causing the failures:

template <typename T>
struct base {
    using type = int;
};

template <typename T>
struct derived : base<T> {
    using type = /*typename*/ derived::type; // Finds base<T>::type
};

template struct derived<int>;

Looks like (ironically) MSVC accepts it, Clang accepts it only since 18, and GCC doesn't accept it at all: https://godbolt.org/z/EK33394hP

@ericniebler
Copy link
Collaborator

template <typename T>
struct derived : base<T> {
    using type = /*typename*/ derived::type; // Finds base<T>::type
};

oh god that's terrible code. where are we doing that? i'd prefer:

template <typename T>
struct derived : base<T> {
    using type = /*typename*/ derived::base::type; // Finds base<T>::type
};

@localspook
Copy link
Author

__state_t in:

template <class _Sexpr, class _Receiver>
struct __op_state : __detail::__op_base<_Sexpr, _Receiver> {
using __desc_t = typename __decay_t<_Sexpr>::__desc_t;
using __tag_t = typename __desc_t::__tag;
using __data_t = typename __desc_t::__data;
using __state_t = typename __op_state::__state_t;

Finds the __state_t in the base class:
template <class _Sexpr, class _Receiver>
struct __op_base : __immovable {
using __tag_t = typename __decay_t<_Sexpr>::__tag_t;
using __state_t = __state_type_t<__tag_t, _Sexpr, _Receiver>;

@ericniebler
Copy link
Collaborator

   using __state_t = typename __op_state::__state_t; 

can you try changing it to:

   using __state_t = typename __op_state::__op_base::__state_t; 

?

@localspook
Copy link
Author

Pushed a commit with that change, please retest

@ericniebler
Copy link
Collaborator

/ok to test 6fa6ba9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants