http://llvm.org/bugs/show_bug.cgi?id=10044
Summary: Scoped enumeration instantiated even if not required
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Clang should not instantiate the definition of the scoped enumeration:
template<typename T>
struct A {
enum class B {
X = T::value
};
};
int main() {
A<int> a;
}
Clang error:
main1.cpp:4:9: error: type 'int' cannot be used prior to '::' because it has no
members
X = T::value
This code looks well-formed. Only if we look into the enumeration, as
"A<int>::B::X", the definition of the enumeration is required to exist and thus
implicitly instantiated. This is specified at 14.7.1p1 and p2.
--
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