brintos

brintos / llvm-project-archived public Read only

0
0
Text · 747 B · a9950a7 Raw
19 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s2// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify -x c %s3 4void clang_analyzer_dump(int);5 6// Ensure that VLA types are correctly handled by unary type traits in the7// expression engine. Previously, __datasizeof and _Countof both caused failed8// assertions.9void gh151711(int i) {10  clang_analyzer_dump(sizeof(int[i++]));       // expected-warning {{Unknown}}11#ifdef __cplusplus12  // __datasizeof is only available in C++.13  clang_analyzer_dump(__datasizeof(int[i++])); // expected-warning {{Unknown}}14#else15  // _Countof is only available in C.16  clang_analyzer_dump(_Countof(int[i++]));     // expected-warning {{Unknown}}17#endif18}19