http://llvm.org/bugs/show_bug.cgi?id=20208
Bug ID: 20208
Summary: Misleading diagnostic for missing initializer for
const POD
Product: clang
Version: trunk
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
$ cat test.cc
struct Bar {
int a;
};
const Bar bar;
$ clang -c test.cc
test.cc:4:11: error: default initialization of an object of const type 'const
Bar' requires a user-provided default constructor
const Bar bar;
^
1 error generated.
That's very misleading, since what's missing is the `= {1};` after `const Bar
bar`. Adding a user-provided default constructor probably isn't what's needed
here.
(And for a struct without fields, maybe the code should just be accepted as-is,
even without the `= {}`?)
--
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