diff --git a/llvm/lib/Support/FileCheck.cpp b/llvm/lib/Support/FileCheck.cpp --- a/llvm/lib/Support/FileCheck.cpp +++ b/llvm/lib/Support/FileCheck.cpp @@ -62,10 +62,7 @@ std::shared_ptr AST, FileCheckExpressionFormat Format) : AST(AST) { - if (Format.Valid) - this->Format = Format; - else - this->Format = FormatUnsigned; + this->Format = Format.Valid ? Format : FormatUnsigned; } Expected FileCheckNumericVariable::eval() const { diff --git a/llvm/unittests/Support/FileCheckTest.cpp b/llvm/unittests/Support/FileCheckTest.cpp --- a/llvm/unittests/Support/FileCheckTest.cpp +++ b/llvm/unittests/Support/FileCheckTest.cpp @@ -96,7 +96,8 @@ } TEST_F(FileCheckTest, Binop) { - auto DefExpression = FileCheckExpression(nullptr, FormatUnsigned); + FileCheckExpression DefExpression = + FileCheckExpression(nullptr, FormatUnsigned); auto FooVar = std::make_shared(1, "FOO", &DefExpression); FooVar->setValue(42);