[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / call-and-message.mm
blob4a1d88f2f098b2dee5f462a33aef5e687be67eb9
1 // RUN: %clang_analyze_cc1 %s -verify \
2 // RUN:   -analyzer-checker=core \
3 // RUN:   -analyzer-config core.CallAndMessage:FunctionPointer=false \
4 // RUN:   -analyzer-config core.CallAndMessage:ParameterCount=false \
5 // RUN:   -analyzer-config core.CallAndMessage:CXXThisMethodCall=false \
6 // RUN:   -analyzer-config core.CallAndMessage:CXXDeallocationArg=false \
7 // RUN:   -analyzer-config core.CallAndMessage:ArgInitializedness=false \
8 // RUN:   -analyzer-config core.CallAndMessage:ArgPointeeInitializedness=false \
9 // RUN:   -analyzer-config core.CallAndMessage:NilReceiver=true \
10 // RUN:   -analyzer-config core.CallAndMessage:UndefReceiver=false \
11 // RUN:   -analyzer-output=plist -o %t.plist
12 // RUN: cat %t.plist | FileCheck %s
14 @interface Foo
15 - (int &)ref;
16 @end
18 Foo *getFoo() { return 0; }
20 void testNullPointerSuppression() {
21   getFoo().ref = 1;
24 void testPositiveNullReference() {
25   Foo *x = 0;
26   x.ref = 1; // expected-warning {{The receiver of message 'ref' is nil, which results in forming a null reference [core.CallAndMessage]}}
29 // TODO: If this hash ever changes, turn core.CallAndMessage:NilReceiver from a
30 // checker option into a checker, as described in the CallAndMessage comments!
31 // CHECK: <key>issue_hash_content_of_line_in_context</key>
32 // CHECK-SAME: <string>abe2e0574dd901094c511bae2f93f926</string>