[llvm-bugs] [Bug 50496] New: Use of auto template parameters breaks partial specialization
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed May 26 12:26:45 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50496
Bug ID: 50496
Summary: Use of auto template parameters breaks partial
specialization
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++17
Assignee: unassignedclangbugs at nondot.org
Reporter: eniebler at boost.org
CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk
The following code fails to compile, but should:
inline constexpr struct S {} C {};
template <class S>
struct traits;
template <auto& A>
struct odd {};
template <auto& A>
struct traits<odd<A>> {};
int main() {
traits<odd<C>> t; // ERROR HERE
}
The commented line in main generated the following error:
error: implicit instantiation of undefined template 'traits<odd<C>>'
traits<odd<C>> t;
^
The partial specialization with the auto template parameter fails to match the
instantiation.
GCC accepts the code. A slight tweak causes clang to accept the code (replacing
`auto&` with `const auto&`.
https://godbolt.org/z/M7Y9nvva3
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210526/f05ffaf6/attachment.html>
More information about the llvm-bugs
mailing list