]> granicus.if.org Git - clang/commitdiff
Add test case for <rdar://problem/8610363> (a bogus report of using an uninitialized...
authorTed Kremenek <kremenek@apple.com>
Sat, 30 Oct 2010 00:43:15 +0000 (00:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 30 Oct 2010 00:43:15 +0000 (00:43 +0000)
already fixed, but this serves for detecting regressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117754 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/uninitialized.cpp [new file with mode: 0644]

diff --git a/test/SemaCXX/uninitialized.cpp b/test/SemaCXX/uninitialized.cpp
new file mode 100644 (file)
index 0000000..26202fb
--- /dev/null
@@ -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
+};