aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-tidy/checkers/readability/simplify-boolean-expr-cxx17.cpp
blob: 310afe04672aeb1a2b8b5ce0ce11f878dc6d6870 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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;
}