[Mlir-commits] [mlir] 604aba0 - [mlir] Fix -Wunused-variable warning in AsmParserState.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Thu Aug 24 19:15:47 PDT 2023


Author: Jie Fu
Date: 2023-08-25T10:13:48+08:00
New Revision: 604aba0c8b79c48b7330ad654067c671786984c2

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

LOG: [mlir] Fix -Wunused-variable warning in AsmParserState.cpp (NFC)

/data/llvm-project/mlir/lib/AsmParser/AsmParserState.cpp:293:8: error: unused variable '[it, inserted]' [-Werror,-Wunused-variable]
  auto [it, inserted] =
       ^
1 error generated.

Added: 
    

Modified: 
    mlir/lib/AsmParser/AsmParserState.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/AsmParser/AsmParserState.cpp b/mlir/lib/AsmParser/AsmParserState.cpp
index 38f427f97ab0e5..672f1ce860cb17 100644
--- a/mlir/lib/AsmParser/AsmParserState.cpp
+++ b/mlir/lib/AsmParser/AsmParserState.cpp
@@ -290,7 +290,7 @@ void AsmParserState::addAttrAliasDefinition(StringRef name, SMRange location) {
 }
 
 void AsmParserState::addTypeAliasDefinition(StringRef name, SMRange location) {
-  auto [it, inserted] =
+  [[maybe_unused]] auto [it, inserted] =
       impl->typeAliasToIdx.try_emplace(name, impl->typeAliases.size());
   assert(inserted && "unexpected attribute alias redefinition");
   impl->typeAliases.push_back(


        


More information about the Mlir-commits mailing list