[clang] 7974f12 - [HLSL] Suppress a warning in #122820 [-Wunused-but-set-variable]

NAKAMURA Takumi via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 25 01:33:29 PST 2025


Author: NAKAMURA Takumi
Date: 2025-01-25T18:32:29+09:00
New Revision: 7974f12b1e3682514bd58b35c5a784f35938fa04

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

LOG: [HLSL] Suppress a warning in #122820 [-Wunused-but-set-variable]

Added: 
    

Modified: 
    clang/lib/Sema/SemaHLSL.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index a7033cb54886a7..aa99b44958eafd 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -425,6 +425,7 @@ static CXXRecordDecl *createHostLayoutStruct(Sema &S,
   // copy base struct, create HLSL Buffer compatible version if needed
   if (unsigned NumBases = StructDecl->getNumBases()) {
     assert(NumBases == 1 && "HLSL supports only one base type");
+    (void)NumBases;
     CXXBaseSpecifier Base = *StructDecl->bases_begin();
     CXXRecordDecl *BaseDecl = Base.getType()->getAsCXXRecordDecl();
     if (requiresImplicitBufferLayoutStructure(BaseDecl)) {


        


More information about the cfe-commits mailing list