f4a2713ac8
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
17 lines
No EOL
574 B
C++
17 lines
No EOL
574 B
C++
// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection %s -analyzer-output=text -verify
|
|
|
|
void clang_analyzer_eval(bool);
|
|
|
|
// Test that the analyzer does not crash on GNU extension operator "?:".
|
|
void NoCrashTest(int x, int y) {
|
|
int w = x ?: y;
|
|
}
|
|
|
|
void OperatorEvaluationTest(int y) {
|
|
int x = 1;
|
|
int w = x ?: y; // expected-note {{'?' condition is true}}
|
|
|
|
// TODO: We are not precise when processing the "?:" operator in C++.
|
|
clang_analyzer_eval(w == 1); // expected-warning{{UNKNOWN}}
|
|
// expected-note@-1{{UNKNOWN}}
|
|
} |