[cfe-commits] r117754 - /cfe/trunk/test/SemaCXX/uninitialized.cpp

Ted Kremenek kremenek at apple.com
Fri Oct 29 17:43:15 PDT 2010


Author: kremenek
Date: Fri Oct 29 19:43:15 2010
New Revision: 117754

URL: http://llvm.org/viewvc/llvm-project?rev=117754&view=rev
Log:
Add test case for <rdar://problem/8610363> (a bogus report of using an uninitialized field).  This was
already fixed, but this serves for detecting regressions.

Added:
    cfe/trunk/test/SemaCXX/uninitialized.cpp

Added: cfe/trunk/test/SemaCXX/uninitialized.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/uninitialized.cpp?rev=117754&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/uninitialized.cpp (added)
+++ cfe/trunk/test/SemaCXX/uninitialized.cpp Fri Oct 29 19:43:15 2010
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only -Wall -Wuninitialized -verify %s
+
+// Previously this triggered a warning on the sizeof(fieldB), indicating
+// a use of an uninitialized value.
+class Rdar8610363_A {
+  int fieldA;
+public:
+  Rdar8610363_A(int a); 
+};
+class Rdar8610363_B {
+  Rdar8610363_A fieldB;
+public:
+  Rdar8610363_B(int b) : fieldB(sizeof(fieldB)) {} // no-warning
+};





More information about the cfe-commits mailing list