Hi,
clang's analyzer doesn't seem to emit diagnostics for uninstantiated
classes. Can I as a frontend user turn these on with some flag?
The current situation is a little unfortunate when developing library
code: the library might not instantiate all its types while in user code
the definitions of all functions might not be available.
I see this behavior e.g. in r192680.
Example:
struct A {
void setup() { n = N; }
A() {
setup();
N = 1;
}
int N, n;
};
int main() {
//A a; // **HERE**
}
With the line marked **HERE** commented out `clang --analyze` finds nothing,
while with it active I get what I wanted:
test.cpp:2:20: warning: Assigned value is garbage or undefined
void setup() { n = N; }
^ ~
1 warning generated
What awesome times were I am surprised by this kind of problem, thanks
for the great work,
Benjamin