[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / test / Analysis / reinterpret-cast-pointer-to-member.cpp
blobc457d2230dddcd43a7d9a1acdc3c1e6e1287ab57
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
2 // XFAIL: asserts
4 void clang_analyzer_eval(bool);
6 // TODO: The following test will work properly once reinterpret_cast on pointer-to-member is handled properly
7 namespace testReinterpretCasting {
8 struct Base {
9 int field;
12 struct Derived : public Base {};
14 struct DoubleDerived : public Derived {};
16 struct Some {};
18 void f() {
19 int DoubleDerived::*ddf = &Base::field;
20 int Base::*bf = reinterpret_cast<int Base::*>(reinterpret_cast<int Derived::*>(reinterpret_cast<int Base::*>(ddf)));
21 int Some::*sf = reinterpret_cast<int Some::*>(ddf);
22 Base base;
23 base.field = 13;
24 clang_analyzer_eval(base.*bf == 13); // expected-warning{{TRUE}}
26 } // namespace testReinterpretCasting