https://bugs.llvm.org/show_bug.cgi?id=39215
Bug ID: 39215
Summary: Explicit template instantiation can't be combined with
specialization
Product: clang
Version: 7.0
Hardware: PC
OS: MacOS X
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: o_knieme...@maxon.de
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
As far as I understand the C++17 standard, the code below should compile. I.e.,
it should be possible to give the definition for an explicit template
instantiation declaration by an explicit specialization.
C++17 17.7.2.5 is
"For a given set of template arguments, if an explicit instantiation of a
template appears after a declaration of an explicit specialization for that
template, the explicit instantiation has no effect. Otherwise, for an explicit
instantiation definition the definition of a function template, a variable
template, a member function template, or a member function or static data
member of a class template shall be present in every translation unit in which
it is explicitly instantiated."
GCC and Intel compile the code without errors.
template <typename T> struct S
{
static const char* s;
};
extern template const char* S<void>::s;
template <> const char* S<void>::s = "void";
// the following should have no effect according to standard
// template const char* S<void>::s;
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs