[clang] b2dabd2 - [Sema] Fix warnings

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 3 14:31:16 PDT 2024


Author: Kazu Hirata
Date: 2024-09-03T14:31:11-07:00
New Revision: b2dabd2b06cb0ca5ea534bafe33c5cff5521be18

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

LOG: [Sema] Fix warnings

This patch fixes:

  clang/lib/Sema/SemaHLSL.cpp:838:12: error: unused variable
  'TheVarDecl' [-Werror,-Wunused-variable]

  clang/lib/Sema/SemaHLSL.cpp:840:19: error: unused variable
  'CBufferOrTBuffer' [-Werror,-Wunused-variable]

Added: 
    

Modified: 
    clang/lib/Sema/SemaHLSL.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaHLSL.cpp b/clang/lib/Sema/SemaHLSL.cpp
index 05d2bdf8a57a27..778d524a005482 100644
--- a/clang/lib/Sema/SemaHLSL.cpp
+++ b/clang/lib/Sema/SemaHLSL.cpp
@@ -843,6 +843,8 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc,
   assert(((TheVarDecl && !CBufferOrTBuffer) ||
           (!TheVarDecl && CBufferOrTBuffer)) &&
          "either TheVarDecl or CBufferOrTBuffer should be set");
+  (void)TheVarDecl;
+  (void)CBufferOrTBuffer;
 
   RegisterBindingFlags Flags = HLSLFillRegisterBindingFlags(S, TheDecl);
   assert((int)Flags.Other + (int)Flags.Resource + (int)Flags.Basic +


        


More information about the cfe-commits mailing list