Debian Codegraph @

clang/test/Analysis/engine/gh151711.cpp

raw
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
2 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify -x c %s
3
4 void clang_analyzer_dump(int);
5
6 // Ensure that VLA types are correctly handled by unary type traits in the
7 // expression engine. Previously, __datasizeof and _Countof both caused failed
8 // assertions.
9 void gh151711(int i) {
10 clang_analyzer_dump(sizeof(int[i++])); // expected-warning {{Unknown}}
11 #ifdef __cplusplus
12 // __datasizeof is only available in C++.
13 clang_analyzer_dump(__datasizeof(int[i++])); // expected-warning {{Unknown}}
14 #else
15 // _Countof is only available in C.
16 clang_analyzer_dump(_Countof(int[i++])); // expected-warning {{Unknown}}
17 #endif
18 }