https://bugs.llvm.org/show_bug.cgi?id=47692
Bug ID: 47692
Summary: Bogus -Winvalid-partial-specialization when
specialization has `const auto&` NTTP parameter
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: arthur.j.odw...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk
// https://godbolt.org/z/b7W4TY
template<auto&> struct A { int i = 1; };
template<const auto& X> struct A<X> { int i = 2; };
====
<source>:2:32: error: class template partial specialization is not more
specialized than the primary template [-Winvalid-partial-specialization]
template<const auto& X> struct A<X> { int i = 2; };
^
<source>:1:24: note: template is declared here
template<auto&> struct A { int i = 1; };
^
1 error generated.
====
GCC and MSVC both accept this code, and do generate `A<i>` from the partial
specialization whenever `i` is a const variable.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs