http://llvm.org/bugs/show_bug.cgi?id=20346
Bug ID: 20346
Summary: Strang diagnostic on struct initializer in template
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
struct S { short inner_s; };
struct outer_struct {
wchar_t arr[32];
S outer_s;
};
template <class T>
void OpenFileSession() {
outer_struct asdfasdf = {};
};
void foo() {
OpenFileSession<int>();
}
$ ~/src/llvm-build/bin/clang -c test.cc
error: cannot initialize an array element of type 'wchar_t' with an rvalue of
type 'wchar_t [32]'
test.cc:14:3: note: in instantiation of function template specialization
'OpenFileSession<int>' requested here
OpenFileSession<int>();
^
Note: No source location on the error. And gcc and msvc compile this code fine.
(At least the missing source loc should be fixed for sure.)
--
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