diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-10-30 00:43:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-10-30 00:43:15 +0000 |
commit | c00d5b970629c5e43afc1d14d65c7b219aa79174 (patch) | |
tree | d4bfb22c9f42a44c33498c37db3e04f858b0be9f /clang/test/SemaCXX/uninitialized.cpp | |
parent | 74ef9e184efa2c077fdd69f0a486df1151bd87dd (diff) | |
download | bcm5719-llvm-c00d5b970629c5e43afc1d14d65c7b219aa79174.tar.gz bcm5719-llvm-c00d5b970629c5e43afc1d14d65c7b219aa79174.zip |
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.
llvm-svn: 117754
Diffstat (limited to 'clang/test/SemaCXX/uninitialized.cpp')
-rw-r--r-- | clang/test/SemaCXX/uninitialized.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/uninitialized.cpp b/clang/test/SemaCXX/uninitialized.cpp new file mode 100644 index 00000000000..26202fbccc8 --- /dev/null +++ b/clang/test/SemaCXX/uninitialized.cpp @@ -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 +}; |