bolt/deps/llvm-18.1.8/clang-tools-extra/test/clang-tidy/checkers/readability/simplify-boolean-expr-cxx17.cpp
2025-02-14 19:21:04 +01:00

19 lines
349 B
C++

// RUN: clang-tidy %s -checks='-*,readability-simplify-boolean-expr' -- -std=c++17 | count 0
struct RAII {};
bool foo(bool Cond) {
bool Result;
if (RAII Object; Cond)
Result = true;
else
Result = false;
if (bool X = Cond; X)
Result = true;
else
Result = false;
if (bool X = Cond; X)
return true;
return false;
}