No uninitialized warning

Command “clang a.cpp -Weverything” reports a warning as expected for the following code

int main() {
int m(m);
return m;

}

However, no warning is generated for if m is declared as a reference:

int main() {
int &m(m);

return m;

}

Notice that “clang a.cpp --analyze” catches this. Should “clang a.cpp -Weverything” catch it as well? Thanks!

Wei

Command “clang a.cpp -Weverything” reports a warning as expected for the
following code

int main() {
   int m(m);
  return m;
}

However, no warning is generated for if m is declared as a reference:

int main() {
   int &m(m);
  return m;
}

Interesting. It does warn if you change it to "int &m = m".

Notice that “clang a.cpp --analyze” catches this. Should “clang a.cpp
-Weverything” catch it as well? Thanks!

Yes, I think it should. I'll take a look.

Thanks,
Hans