This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77435] New: Dependent reference non-type template parameter not matched for partial specialization
- From: "ed at catmur dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 31 Aug 2016 20:59:23 +0000
- Subject: [Bug c++/77435] New: Dependent reference non-type template parameter not matched for partial specialization
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77435
Bug ID: 77435
Summary: Dependent reference non-type template parameter not
matched for partial specialization
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot co.uk
Target Milestone: ---
template<int, class T, T> struct S;
template<class T, T A> struct S<0, T, A> {};
int i;
S<0, int*, &i> r; // OK
S<0, int&, i> s; // error: aggregate 'S<0, int&, i> s' has incomplete type
Clang, MSVC accept this.
I can't find anything in [temp.deduct] that would be cause to consider the
partial specialization non-matching.
Workaround is to add a more specialized partial specialization for reference
types:
template<class T, T& A> struct S<0, T&, A> {};
If instead I add a partial specialization for reference non-type parameters,
gcc accepts but clang and MSVC consider ambiguous:
template<class T, T& A> struct S<0, T, A> {};