https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93534
Bug ID: 93534
Summary: Overloading of Variadic function templates are not be
ambiguous
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: merukun1125 at docomo dot ne.jp
Target Milestone: ---
The following code overload may be ambiguous and gives an error in clang, but
not in gcc:
#include <type_traits>
template<typename... T, std::void_t<T...>* = nullptr>
void func(T...) {}
template<typename... T>
void func(T...) {}
int main() {
func(3.14);
}
The following code that does not use variadic templates will error in both gcc
and clang:
#include <type_traits>
template<typename T, std::void_t<T>* = nullptr>
void func(T) {}
template<typename T>
void func(T) {}
int main() {
func(3.14);
}
I think the first code overload should be ambiguous.