[clang] fcbb4e1 - [NFCI] Fix unused variable warning with asserts off in clang/lib/Sema/TypeLocBuilder.cpp

Jorge Gorbe Moya via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 12 17:41:18 PDT 2022


Author: Jorge Gorbe Moya
Date: 2022-07-12T17:40:41-07:00
New Revision: fcbb4e1fa42793edc9531d59d047e6bd0909d3d3

URL: https://github.com/llvm/llvm-project/commit/fcbb4e1fa42793edc9531d59d047e6bd0909d3d3
DIFF: https://github.com/llvm/llvm-project/commit/fcbb4e1fa42793edc9531d59d047e6bd0909d3d3.diff

LOG: [NFCI] Fix unused variable warning with asserts off in clang/lib/Sema/TypeLocBuilder.cpp

Added: 
    

Modified: 
    clang/lib/Sema/TypeLocBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/TypeLocBuilder.cpp b/clang/lib/Sema/TypeLocBuilder.cpp
index d2360224ac60..3699b5dffe8a 100644
--- a/clang/lib/Sema/TypeLocBuilder.cpp
+++ b/clang/lib/Sema/TypeLocBuilder.cpp
@@ -156,8 +156,7 @@ TypeLoc TypeLocBuilder::pushImpl(QualType T, size_t LocalSize, unsigned LocalAli
 
   Index -= LocalSize;
 
-  unsigned FDSz = TypeLoc::getFullDataSizeForType(T);
-  assert(Capacity - Index == FDSz &&
+  assert(Capacity - Index == TypeLoc::getFullDataSizeForType(T) &&
          "incorrect data size provided to CreateTypeSourceInfo!");
 
   return getTemporaryTypeLoc(T);


        


More information about the cfe-commits mailing list