-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Closed
Copy link
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
It seems that clang does not consider sizeof...(xs) to be a dependent expression when the call to foo is made with a known number of arguments. The expression must absolutely contain xs....
The following code compiles with gcc, but not clang (https://godbolt.org/z/TYzvjTePT):
template<int>
struct foo_impl {
template<class>
using f = int;
};
template<class... xs> constexpr int sizeof_pack = sizeof...(xs);
template<class... xs>
using foo = typename foo_impl< // error: pack expansion used as argument for non-pack parameter of alias template
sizeof...(xs) // does not work
// sizeof_pack<xs...> // ok
>::template f<xs...>; // f is dependent on xs
template<class... xs>
using test = list<foo<xs>...>;
// template<class... xs>
// using test = foo<xs...>; // ok with pack...
test<int> a; // koMetadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"