diff --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp --- a/clang-tools-extra/clangd/Hover.cpp +++ b/clang-tools-extra/clangd/Hover.cpp @@ -725,7 +725,7 @@ bool isLiteral(const Expr *E) { // Unfortunately there's no common base Literal classes inherits from // (apart from Expr), therefore these exclusions. - return llvm::isa(E) || llvm::isa(E) || + return llvm::isa(E) || llvm::isa(E) || llvm::isa(E) || llvm::isa(E) || llvm::isa(E) || diff --git a/clang-tools-extra/clangd/unittests/HoverTests.cpp b/clang-tools-extra/clangd/unittests/HoverTests.cpp --- a/clang-tools-extra/clangd/unittests/HoverTests.cpp +++ b/clang-tools-extra/clangd/unittests/HoverTests.cpp @@ -1224,7 +1224,6 @@ )cpp", // literals "auto x = t^rue;", - "auto x = '^A';", "auto x = ^(int){42};", "auto x = ^42.;", "auto x = ^42.0i;", @@ -1250,6 +1249,11 @@ const char *const Code; const std::function ExpectedBuilder; } Cases[] = { + {"auto x = [['^A']]; // character literal", + [](HoverInfo &HI) { + HI.Name = "expression", HI.Type = "char"; + HI.Value = "65 (0x41)"; + }}, { R"cpp(// Local variable int main() {