[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / Analysis / member-expr.cpp
blob8fb6fe48f01c7f2ed6f69b720ea1e5e70f4a6d45
1 // RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker=core,debug.ExprInspection %s -verify
3 void clang_analyzer_checkInlined(bool);
4 void clang_analyzer_eval(int);
6 namespace EnumsViaMemberExpr {
7 struct Foo {
8 enum E {
9 Bar = 1
13 void testEnumVal(Foo Baz) {
14 clang_analyzer_eval(Baz.Bar == Foo::Bar); // expected-warning{{TRUE}}
17 void testEnumRef(Foo &Baz) {
18 clang_analyzer_eval(Baz.Bar == Foo::Bar); // expected-warning{{TRUE}}
21 void testEnumPtr(Foo *Baz) {
22 clang_analyzer_eval(Baz->Bar == Foo::Bar); // expected-warning{{TRUE}}
26 namespace PR19531 {
27 struct A {
28 A() : x(0) {}
29 bool h() const;
30 int x;
33 struct B {
34 void g(bool (A::*mp_f)() const) {
35 // This used to trigger an assertion because the 'this' pointer is a
36 // temporary.
37 (A().*mp_f)();
39 void f() { g(&A::h); }