Yes, it does. isIntegerConstantExpr assigns a value to CoprocNoAP. -- Regards, Mikhail Maltsev
________________________________________ From: David Blaikie <dblai...@gmail.com> Sent: Sunday, March 22, 2020 03:32 To: Mikhail Maltsev; Mikhail Maltsev Cc: cfe-commits Subject: Re: [clang] 43606ef - Suppress an "unused variable" warning in release build Does "isIntegerConstantExpr" have side effects that are desired/necessary? Otherwise please change this to roll the isIntegerConstantExpr into the assert (so that it is only executed when asserts are enabled) On Tue, Mar 10, 2020 at 10:11 AM Mikhail Maltsev via cfe-commits <cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org>> wrote: Author: Mikhail Maltsev Date: 2020-03-10T17:10:52Z New Revision: 43606efb6847fc9c79e7d93760a2a6191e8a8539 URL: https://github.com/llvm/llvm-project/commit/43606efb6847fc9c79e7d93760a2a6191e8a8539 DIFF: https://github.com/llvm/llvm-project/commit/43606efb6847fc9c79e7d93760a2a6191e8a8539.diff LOG: Suppress an "unused variable" warning in release build Added: Modified: clang/lib/Sema/SemaChecking.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 24d0d9209a1d..8a2b4b019663 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2094,6 +2094,7 @@ bool Sema::CheckARMCoprocessorImmediate(const Expr *CoprocArg, bool WantCDE) { llvm::APSInt CoprocNoAP; bool IsICE = CoprocArg->isIntegerConstantExpr(CoprocNoAP, Context); + (void)IsICE; assert(IsICE && "Coprocossor immediate is not a constant expression"); int64_t CoprocNo = CoprocNoAP.getExtValue(); assert(CoprocNo >= 0 && "Coprocessor immediate must be non-negative"); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org<mailto:cfe-commits@lists.llvm.org> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits