https://bugs.llvm.org/show_bug.cgi?id=49079
Bug ID: 49079
Summary: Type mismatch for pointer to template template
function
Product: clang
Version: 11.0
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++17
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
If a function is a template template function (template<template<typename>
class> void foo(int&)), and a template template parameter has a default value,
it does not fit to function pointer type.
Example:
> template<typename, typename = int> class A { };
>
> template<template<typename> class> void foo(int&);
> void bar(void(*)(int&));
>
> int main()
> {
> bar(foo<A>);
> }
Output:
> <source>:8:5: error: no matching function for call to 'bar'
> bar(foo<A>);
> ^~~
> <source>:4:6: note: candidate function not viable:
> no overload of 'foo' matching 'void (*)(int &)' for 1st argument
> void bar(void(*)(int&));
Godbolt: https://godbolt.org/z/enhYs8
With GCC and MSVC, example compiles fine.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs