https://bugs.llvm.org/show_bug.cgi?id=49711
Bug ID: 49711
Summary: non-type template parameter not working with clang,
but working with gcc
Product: clang
Version: 11.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++2a
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Created attachment 24689
--> https://bugs.llvm.org/attachment.cgi?id=24689&action=edit
c++ file demonstrating bug
This is not working with clang-11.1.0, but working with gcc-10.2.0:
#include <functional>
template <auto op>
constexpr auto compare(auto const ...a) noexcept
{
return op(a...);
}
int main()
{
return compare<std::greater<int>{}>(1, 2);
}
clang++ -std=c++20 a.cpp -o a
a.cpp:11:10: error: no matching function for call to 'compare'
return compare<std::greater<int>{}>(1, 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cpp:4:16: note: candidate template ignored: invalid explicitly-specified
argument for template parameter 'op'
constexpr auto compare(auto const ...a) noexcept
^
1 error generated.
--
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