-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid
Description
The following program is rejected by clang while both gcc and msvc accepts this. Demo
#include <type_traits>
template <typename... T>
struct args_tag
{
using type = std::common_type_t<T...>;
};
template <typename... T>
void bar(args_tag<T...>, std::type_identity_t<T>..., int, std::type_identity_t<T>...) {}
// example
int main() {
bar(args_tag<int, int>{}, 4, 8, 15, 16, 23);
}
Clang says:
<source>:15:5: error: no matching function for call to 'bar'
15 | bar(args_tag<int, int>{}, 4, 8, 15, 16, 23);
| ^~~
<source>:10:6: note: candidate template ignored: deduced packs of different lengths for parameter 'T' (<int, int> vs. <>)
10 | void bar(args_tag<T...>, std::type_identity_t<T>..., int, std::type_identity_t<T>...) {}
| ^
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid