http://llvm.org/bugs/show_bug.cgi?id=22825
Bug ID: 22825
Summary: variable template not default initialized
Product: clang
Version: 3.5
Hardware: Other
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++14
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
// clang reports this as a link error, val is not defined
template<class A> A val ;
void init()
{
val<int> = 55;
}
int main(void)
{
init(); // without init should it be 0?
return val<int>;
}
My guess is that without the call to init it should be default initialized to
0.
tmp/ex9-b3b6e9.o:(.toc+0x0): undefined reference to `val<int>'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
any variable template without an explicit initializer gives a linker error
If the type is a class type there is no diagnostic check to ensure there is a
default constructor, and there is no call to the default constructor.
--
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