diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2016-12-07 16:12:26 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2016-12-07 16:12:26 +0000 |
commit | d69e01297f2c4539debd2f35d66c7013b6fe0cfc (patch) | |
tree | 7a2abcb08d68f834ca654627c2487116432c755d /clang/test/Analysis/malloc.cpp | |
parent | ff79f31328154777a527cd58f567d00c1df0d2ec (diff) | |
download | bcm5719-llvm-d69e01297f2c4539debd2f35d66c7013b6fe0cfc.tar.gz bcm5719-llvm-d69e01297f2c4539debd2f35d66c7013b6fe0cfc.zip |
[analyzer] pr31226: Disable CastSizeChecker in C++ because it's not quite ready.
Avoids a crash and a related false positive.
Investigation by Daniel Krupp!
llvm-svn: 288914
Diffstat (limited to 'clang/test/Analysis/malloc.cpp')
-rw-r--r-- | clang/test/Analysis/malloc.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/clang/test/Analysis/malloc.cpp b/clang/test/Analysis/malloc.cpp index 75d06d66c2c..f24ccf58dc3 100644 --- a/clang/test/Analysis/malloc.cpp +++ b/clang/test/Analysis/malloc.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc -analyzer-store=region -verify %s +// RUN: %clang_cc1 -w -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus.NewDelete -analyzer-store=region -verify %s +// RUN: %clang_cc1 -triple i386-unknown-linux-gnu -w -analyze -analyzer-checker=core,alpha.deadcode.UnreachableCode,alpha.core.CastSize,unix.Malloc,cplusplus.NewDelete -analyzer-store=region -verify %s typedef __typeof(sizeof(int)) size_t; void *malloc(size_t); @@ -105,4 +106,22 @@ void appendWrapperNested(char *getterName) { void fooNested(const char* name) { char* getterName = strdup(name); appendWrapperNested(getterName); // no-warning -}
\ No newline at end of file +} + +namespace PR31226 { + struct b2 { + int f; + }; + + struct b1 : virtual b2 { + void m(); + }; + + struct d : b1, b2 { + }; + + void f() { + d *p = new d(); + p->m(); // no-crash // no-warning + } +} |