]> granicus.if.org Git - clang/commit
Modify the uninitialized field visitor to detect uninitialized use across the
authorRichard Trieu <rtrieu@google.com>
Fri, 20 Sep 2013 03:03:06 +0000 (03:03 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 20 Sep 2013 03:03:06 +0000 (03:03 +0000)
commitef8f90caa14d85cffba2fea4b6bd425c3b22eea7
tree26bf7577be884afd0f0f2ef46588c6d5752286ad
parent75bd9ed70cec21b4395d701d371356cfe3ec9aae
Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class.  This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
  int x;
  int y;
  A() : x(y) {}  // y is initialized after x, warn here
  A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191068 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclCXX.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p7.cpp
test/Parser/cxx-ambig-init-templ.cpp
test/SemaCXX/constexpr-value-init.cpp
test/SemaCXX/cxx0x-class.cpp
test/SemaCXX/uninitialized.cpp
test/SemaCXX/warn-unused-private-field.cpp