[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / inlining / dyn-dispatch-bifurcate.cpp
blob531fc34854503d95f7bc16424956db4a54dcb88a
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify -Wno-reinterpret-base-class -analyzer-config eagerly-assume=false %s
3 void clang_analyzer_eval(bool);
5 class A {
6 public:
7 virtual int get() { return 0; }
8 };
10 void testBifurcation(A *a) {
11 clang_analyzer_eval(a->get() == 0); // expected-warning{{TRUE}} expected-warning{{UNKNOWN}}
14 void testKnown() {
15 A a;
16 clang_analyzer_eval(a.get() == 0); // expected-warning{{TRUE}}
19 void testNew() {
20 A *a = new A();
21 clang_analyzer_eval(a->get() == 0); // expected-warning{{TRUE}}
25 namespace ReinterpretDisruptsDynamicTypeInfo {
26 class Parent {};
28 class Child : public Parent {
29 public:
30 virtual int foo() { return 42; }
33 void test(Parent *a) {
34 Child *b = reinterpret_cast<Child *>(a);
35 if (!b) return;
36 clang_analyzer_eval(b->foo() == 42); // expected-warning{{UNKNOWN}}