[PATCH] Make UninitializedValues detect the use of uninitialized fields in a constructor.

Richard Smith richard at metafoo.co.uk
Mon Nov 18 14:00:45 PST 2013



================
Comment at: include/clang/Analysis/Analyses/UninitializedValues.h:51
@@ -49,1 +50,3 @@
 
+  /// If the use refers to a field, the use happens in this constructor.
+  const CXXConstructorDecl *Constructor;
----------------
Please extend the comment here: something like "If the use happens in a default initializer for a field, this is the constructor in which the default initializer was used."

================
Comment at: include/clang/Analysis/Analyses/UninitializedValues.h:73
@@ -67,2 +72,3 @@
   const Expr *getUser() const { return User; }
+  const CXXConstructorDecl *getConstructor() const { return Constructor; }
 
----------------
Maybe `getConstructorForDefaultInit`?


http://llvm-reviews.chandlerc.com/D2181



More information about the cfe-commits mailing list