diff options
author | Jie Fu <jiefu@tencent.com> | 2023-12-09 19:13:30 +0800 |
---|---|---|
committer | Jie Fu <jiefu@tencent.com> | 2023-12-09 19:13:30 +0800 |
commit | 3ec6c72551846b8f4143c8c101a1a6203e85a2aa (patch) | |
tree | 83bff2ea6485c4e395b8f542465eda3e619dfad8 | |
parent | fa981f57dde30fdae3c169182f5a354f375cff7a (diff) | |
download | llvm-3ec6c72551846b8f4143c8c101a1a6203e85a2aa.zip llvm-3ec6c72551846b8f4143c8c101a1a6203e85a2aa.tar.gz llvm-3ec6c72551846b8f4143c8c101a1a6203e85a2aa.tar.bz2 |
[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.
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 9bef707..f035c14 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) { |