[PATCH] misc-uninitialized-field
Alexander Kornienko
alexfh at google.com
Mon Jun 22 03:26:40 PDT 2015
================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:25
@@ +24,3 @@
+static bool fieldRequiresInit(const clang::FieldDecl *f) {
+ if (f->getType()->isPointerType())
+ return true;
----------------
alexfh wrote:
> return f->getType()->isPointerType() || f->getType()->isBuiltinType();
Did you miss this comment?
================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:56
@@ +55,3 @@
+
+ for (clang::CXXCtorInitializer *Init : Ctor->inits()) {
+ const FieldDecl *MemberField = Init->getMember();
----------------
alexfh wrote:
> What about fields initialized in the constructor body?
What about this?
================
Comment at: clang-tidy/misc/UninitializedFieldCheck.cpp:70
@@ +69,3 @@
+
+ std::stringstream ss;
+ for (const auto MemberField : MemberFields)
----------------
alexfh wrote:
> In LLVM code, `llvm::raw_string_ostream` or `llvm::raw_svector_ostream` are used instead of `std::stringstream`.
Did you miss this comment?
http://reviews.llvm.org/D10553
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list