[clang-tools-extra] fbf1745 - [clangd] Escape error message in AddUsing

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 28 05:52:38 PDT 2021


Author: Kadir Cetinkaya
Date: 2021-10-28T14:52:12+02:00
New Revision: fbf1745722a0df95608128561d58744ae7b6f311

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

LOG: [clangd] Escape error message in AddUsing

Fixes https://github.com/clangd/clangd/issues/900

Added: 
    

Modified: 
    clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
index c1adbdde6199d..c87b8864d6e6d 100644
--- a/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
+++ b/clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp
@@ -187,7 +187,7 @@ findInsertionPoint(const Tweak::Selection &Inputs,
       return Tok.kind() == tok::l_brace;
     });
     if (Tok == Toks.end() || Tok->endLocation().isInvalid()) {
-      return error("Namespace with no {");
+      return error("Namespace with no {{");
     }
     if (!Tok->endLocation().isMacroID() && IsValidPoint(Tok->endLocation())) {
       InsertionPointData Out;


        


More information about the cfe-commits mailing list