[clang-tools-extra] 40514a7 - [clangd] Add workaround for GCC5 host compilers. NFC.

Michael Liao via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 16 13:05:54 PST 2020


Author: Michael Liao
Date: 2020-01-16T16:05:22-05:00
New Revision: 40514a7d7a3b745ba43c2d014e54a0d78d65d957

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

LOG: [clangd] Add workaround for GCC5 host compilers. NFC.

Added: 
    

Modified: 
    clang-tools-extra/clangd/Hover.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp
index cfa5e3bf93fb..ad715db4d5eb 100644
--- a/clang-tools-extra/clangd/Hover.cpp
+++ b/clang-tools-extra/clangd/Hover.cpp
@@ -439,7 +439,13 @@ bool isLiteral(const Expr *E) {
 
 llvm::StringLiteral getNameForExpr(const Expr *E) {
   // FIXME: Come up with names for `special` expressions.
-  return "expression";
+  //
+  // It's an known issue for GCC5, https://godbolt.org/z/Z_tbgi. Work around
+  // that by using explicit conversion constructor.
+  //
+  // TODO: Once GCC5 is fully retired and not the minimal requirement as stated
+  // in `GettingStarted`, please remove the explicit conversion constructor.
+  return llvm::StringLiteral("expression");
 }
 
 // Generates hover info for evaluatable expressions.


        


More information about the cfe-commits mailing list