http://llvm.org/bugs/show_bug.cgi?id=8771
Summary: Redeclaring partial specializations is disallowed
sometimes
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Clang does in general accept redeclaring partial specializations, like
requested by 9.2[class.mem]p1, but does not do so in the following example,
which I derived from wg21 core issue #996
template<typename T, typename U>
struct Outer {
template<typename X, typename Y> struct Inner;
template<typename Y> struct Inner<T, Y>;
template<typename Y> struct Inner<U, Y> {};
};
Outer<int, int> outer;
This is a "declared and then later defined" scenario of a member class
template, but Clang shouts:
main1.cpp:5:33: error: class template partial specialization 'Inner<int, Y>'
cannot be redeclared
template<typename Y> struct Inner<U, Y> {};
^
main1.cpp:8:19: note: in instantiation of template class 'Outer<int, int>'
requested here
Outer<int, int> outer;
^
main1.cpp:4:33: note: previous declaration of class template partial
specialization 'Inner<int, type-parameter-0-0>' is here
template<typename Y> struct Inner<T, Y>;
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs