diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-04-02 00:26:35 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-04-02 00:26:35 +0000 |
commit | c63a460d78a7625ff38d2b3580f78030c44f07db (patch) | |
tree | 92f8f273c29d583cb32ed3fabc63c67cd5473937 /test/Analysis/diagnostics/explicit-suppression.cpp | |
parent | c9092bb5eb67d859122abb69a0ef61e9249500cd (diff) |
[analyzer] For now, don't inline [cd]tors of C++ containers.
This is a heuristic to make up for the fact that the analyzer doesn't
model C++ containers very well. One example is modeling that
'std::distance(I, E) == 0' implies 'I == E'. In the future, it would be
nice to model this explicitly, but for now it just results in a lot of
false positives.
The actual heuristic checks if the base type has a member named 'begin' or
'iterator'. If so, we treat the constructors and destructors of that type
as opaque, rather than inlining them.
This is intended to drastically reduce the number of false positives
reported with experimental destructor support turned on. We can tweak the
heuristic in the future, but we'd rather err on the side of false negatives
for now.
<rdar://problem/13497258>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/diagnostics/explicit-suppression.cpp')
-rw-r--r-- | test/Analysis/diagnostics/explicit-suppression.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/Analysis/diagnostics/explicit-suppression.cpp b/test/Analysis/diagnostics/explicit-suppression.cpp index 6bc950f5d5..79afeed6c5 100644 --- a/test/Analysis/diagnostics/explicit-suppression.cpp +++ b/test/Analysis/diagnostics/explicit-suppression.cpp @@ -13,7 +13,7 @@ void testCopyNull(int *I, int *E) { std::copy(I, E, (int *)0); #ifndef SUPPRESSED // This line number comes from system-header-simulator-cxx.h. - // expected-warning@65 {{Dereference of null pointer}} + // expected-warning@79 {{Dereference of null pointer}} #endif } @@ -66,6 +66,15 @@ void testCopyNull(int *I, int *E) { + + + + + + + + + // PR15613: expected-* can't refer to diagnostics in other source files. // The current implementation only matches line numbers, but has an upper limit // of the number of lines in the main source file. |