-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang:ast] Avoid warning for unused var without assertions. (NFC) #169822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang:ast] Avoid warning for unused var without assertions. (NFC) #169822
Conversation
This PR suppresses a compiler warning, which turns into an error with `-Werror`, for a variable introduced in llvm#169276 and only used in an assertion (which is, thus, unused if compiled without assertions). Signed-off-by: Ingo Müller <ingomueller@google.com>
|
@llvm/pr-subscribers-clang Author: Ingo Müller (ingomueller-net) ChangesThis PR suppresses a compiler warning, which turns into an error with Full diff: https://github.com/llvm/llvm-project/pull/169822.diff 1 Files Affected:
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 7b9380de6834d..431b58f4627bb 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -12181,6 +12181,7 @@ static bool evalShiftWithCount(
QualType SourceTy = Call->getArg(0)->getType();
QualType CountTy = Call->getArg(1)->getType();
assert(SourceTy->isVectorType() && CountTy->isVectorType());
+ (void)CountTy;
QualType DestEltTy = SourceTy->castAs<VectorType>()->getElementType();
unsigned DestEltWidth = Source.getVectorElt(0).getInt().getBitWidth();
|
clang/lib/AST/ExprConstant.cpp
Outdated
|
|
||
| QualType SourceTy = Call->getArg(0)->getType(); | ||
| QualType CountTy = Call->getArg(1)->getType(); | ||
| assert(SourceTy->isVectorType() && CountTy->isVectorType()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| assert(SourceTy->isVectorType() && CountTy->isVectorType()); | |
| assert(SourceTy->isVectorType() && Call->getArg(1)->getType()->isVectorType()); |
Signed-off-by: Ingo Müller <ingomueller@google.com>
This PR avoids a compiler warning, which turns into an error with
-Werror, for a variable introduced in #169276 and only used in an assertion (which is, thus, unused if compiled without assertions).