[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / clang / test / Analysis / cxx23-static-operator.cpp
blobf380bd0dfa42819cac6d349b1851aefbb4f93b62
1 // RUN: %clang_analyze_cc1 -std=c++2b -verify %s \
2 // RUN: -analyzer-checker=core,debug.ExprInspection
4 template <typename T> void clang_analyzer_dump(T);
6 struct Adder {
7 int data;
8 static int operator()(int x, int y) {
9 clang_analyzer_dump(x); // expected-warning {{1}}
10 clang_analyzer_dump(y); // expected-warning {{2}}
11 return x + y;
15 void static_operator_call_inlines() {
16 Adder s{10};
17 clang_analyzer_dump(s(1, 2)); // expected-warning {{3}}
20 struct DataWithCtor {
21 int x;
22 int y;
23 DataWithCtor(int parm) : x(parm + 10), y(parm + 20) {
24 clang_analyzer_dump(this); // expected-warning {{&v}}
28 struct StaticSubscript {
29 static void operator[](DataWithCtor v) {
30 clang_analyzer_dump(v.x); // expected-warning {{20}}
31 clang_analyzer_dump(v.y); // expected-warning {{30}}
35 void top() {
36 StaticSubscript s;
37 s[DataWithCtor{10}];