Author: Jie Fu Date: 2023-12-09T19:13:30+08:00 New Revision: 3ec6c72551846b8f4143c8c101a1a6203e85a2aa
URL: https://github.com/llvm/llvm-project/commit/3ec6c72551846b8f4143c8c101a1a6203e85a2aa DIFF: https://github.com/llvm/llvm-project/commit/3ec6c72551846b8f4143c8c101a1a6203e85a2aa.diff LOG: [AST] Fix -Wlogical-op-parentheses in ExprConstant.cpp (NFC) llvm-project/clang/lib/AST/ExprConstant.cpp:5645:74: error: '&&' within '||' [-Werror,-Wlogical-op-parentheses] 5645 | (Definition->isConstexpr() || Info.CurrentCall->CanEvalMSConstexpr && | ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ 5646 | Definition->hasAttr<MSConstexprAttr>())) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/clang/lib/AST/ExprConstant.cpp:5645:74: note: place parentheses around the '&&' expression to silence this warning 5645 | (Definition->isConstexpr() || Info.CurrentCall->CanEvalMSConstexpr && | ^ | ( 5646 | Definition->hasAttr<MSConstexprAttr>())) | | ) 1 error generated. Added: Modified: clang/lib/AST/ExprConstant.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 9bef70770a544..f035c1419f4c9 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -5642,8 +5642,8 @@ static bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, // Can we evaluate this function call? if (Definition && Body && - (Definition->isConstexpr() || Info.CurrentCall->CanEvalMSConstexpr && - Definition->hasAttr<MSConstexprAttr>())) + (Definition->isConstexpr() || (Info.CurrentCall->CanEvalMSConstexpr && + Definition->hasAttr<MSConstexprAttr>()))) return true; if (Info.getLangOpts().CPlusPlus11) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits