File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %clang_analyze_cc1 -w -verify %s\
2+ // RUN: -analyzer-checker=core\
3+ // RUN: -analyzer-checker=debug.ExprInspection -std=c++17
4+ // RUN: %clang_analyze_cc1 -w -verify %s\
5+ // RUN: -analyzer-checker=core\
6+ // RUN: -analyzer-checker=debug.ExprInspection -std=c++11\
7+ // RUN: -DTEST_INLINABLE_ALLOCATORS
8+ // RUN: %clang_analyze_cc1 -w -verify %s\
9+ // RUN: -analyzer-checker=core,\
10+ // RUN: -analyzer-checker=debug.ExprInspection -std=c++17\
11+ // RUN: -DTEST_INLINABLE_ALLOCATORS
12+
13+ void clang_analyzer_eval (bool );
14+
15+ typedef __typeof (sizeof (int )) size_t;
16+
17+ namespace CustomClassType {
18+ struct S {
19+ int x;
20+ static void * operator new (size_t size) {
21+ return ::operator new (size);
22+ }
23+ };
24+ void F () {
25+ S *s = new S;
26+ clang_analyzer_eval (s->x ); // expected-warning{{UNKNOWN}} FIXME: should be an undefined warning
27+
28+ S *s2 = new S{};
29+ clang_analyzer_eval (0 == s2->x ); // expected-warning{{TRUE}}
30+
31+ S *s3 = new S{1 };
32+ clang_analyzer_eval (1 == s3->x ); // expected-warning{{TRUE}}
33+ }
34+
35+ struct WithPlacementNew {
36+ };
37+
38+ } // namespace CustomClassType
You can’t perform that action at this time.
0 commit comments