diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-21 10:47:20 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-21 10:47:20 +0000 |
commit | 03f0e2b5b4cedd76f200d1db84f024371e8451b5 (patch) | |
tree | 180c85ad5c00be0a2a9149db91e7a4806f14076a /clang/test/SemaCXX/constructor-initializer.cpp | |
parent | a35499e2aff21be8661081038abf00a4c3f63c4d (diff) | |
download | bcm5719-llvm-03f0e2b5b4cedd76f200d1db84f024371e8451b5.tar.gz bcm5719-llvm-03f0e2b5b4cedd76f200d1db84f024371e8451b5.zip |
Do not warn with -Wuninitialized when the member is used in a sizeof or address-of expression.
Fixes rdar://8331312.
llvm-svn: 114426
Diffstat (limited to 'clang/test/SemaCXX/constructor-initializer.cpp')
-rw-r--r-- | clang/test/SemaCXX/constructor-initializer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp index 31d53302bf4..a74fbe1800e 100644 --- a/clang/test/SemaCXX/constructor-initializer.cpp +++ b/clang/test/SemaCXX/constructor-initializer.cpp @@ -144,9 +144,13 @@ int IntWrapper(int i) { return 0; }; class InitializeUsingSelfExceptions { int A; int B; + int C; + void *P; InitializeUsingSelfExceptions(int B) : A(IntWrapper(A)), // Due to a conservative implementation, we do not report warnings inside function/ctor calls even though it is possible to do so. - B(B) {} // Not a warning; B is a local variable. + B(B), // Not a warning; B is a local variable. + C(sizeof(C)), // sizeof doesn't reference contents, do not warn + P(&P) {} // address-of doesn't reference contents (the pointer may be dereferenced in the same expression but it would be rare; and weird) }; class CopyConstructorTest { |