cor3ntin added a comment. Thanks a lot for working on this. This probably needs a release note entry
================ Comment at: clang/lib/Sema/JumpDiagnostics.cpp:790 // reach this label scope. for (auto [JumpScope, JumpStmt] : JumpScopes) { + // This unnecessary copy is because: ---------------- We don't need to make 3 copies! ================ Comment at: clang/lib/Sema/JumpDiagnostics.cpp:791-800 + // This unnecessary copy is because: + // warning: captured structured bindings are a C++20 extension + // [-Wc++20-extensions] + LabelDecl *TL = TargetLabel; + // Is TargetLabel one of the targets of the JumpStmt? If not, then skip + // it. + if (IsAsmGoto && ---------------- I don't think the pointer adds that much, you can init capture by copy which simplifies a bit ================ Comment at: clang/test/Sema/asm-goto.cpp:71 +l1:; +} ---------------- can you add more tests? Maybe something like that ```cpp void f() { try{ __label__ label; asm goto("" : : : : label); label:; } catch(...){ __label__ label; asm goto("" : : : : label); label:; }; if constexpr(false) { __label__ label; asm goto("" : : : : label); label:; } } ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155342/new/ https://reviews.llvm.org/D155342 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits