summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/unittests/HoverTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/unittests/HoverTests.cpp')
-rw-r--r--clang-tools-extra/clangd/unittests/HoverTests.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/unittests/HoverTests.cpp b/clang-tools-extra/clangd/unittests/HoverTests.cpp
index 5862b1d03bf..3cde2948e36 100644
--- a/clang-tools-extra/clangd/unittests/HoverTests.cpp
+++ b/clang-tools-extra/clangd/unittests/HoverTests.cpp
@@ -506,6 +506,24 @@ void foo())cpp";
HI.NamespaceScope = "";
HI.Value = "&\"1234\"[0]";
}},
+ {R"cpp(// Should not crash
+ template <typename T>
+ struct Tmpl {
+ Tmpl(int name);
+ };
+
+ template <typename A>
+ void boom(int name) {
+ new Tmpl<A>([[na^me]]);
+ })cpp",
+ [](HoverInfo &HI) {
+ HI.Name = "name";
+ HI.Definition = "int name";
+ HI.Kind = index::SymbolKind::Parameter;
+ HI.Type = "int";
+ HI.NamespaceScope = "";
+ HI.LocalScope = "boom::";
+ }},
};
for (const auto &Case : Cases) {
SCOPED_TRACE(Case.Code);
OpenPOWER on IntegriCloud