[PATCH] D65655: [clangd] Fix a crash when presenting values for Hover
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 08:22:34 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL367687: [clangd] Fix a crash when presenting values for Hover (authored by ibiryukov, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D65655?vs=213037&id=213053#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65655/new/
https://reviews.llvm.org/D65655
Files:
clang-tools-extra/trunk/clangd/XRefs.cpp
clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp
Index: clang-tools-extra/trunk/clangd/XRefs.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/XRefs.cpp
+++ clang-tools-extra/trunk/clangd/XRefs.cpp
@@ -715,7 +715,7 @@
HI.Value.emplace();
llvm::raw_string_ostream ValueOS(*HI.Value);
Result.Val.printPretty(ValueOS, const_cast<ASTContext &>(Ctx),
- Var->getType());
+ Init->getType());
}
}
}
Index: clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp
+++ clang-tools-extra/trunk/clangd/unittests/XRefsTests.cpp
@@ -1793,6 +1793,16 @@
"int\n"
"]",
},
+ {
+ R"cpp(// Should not crash when evaluating the initializer.
+ struct Test {};
+ void test() { Test && te^st = {}; }
+ )cpp",
+ "text[Declared in]code[test]\n"
+ "codeblock(cpp) [\n"
+ "struct Test &&test = {}\n"
+ "]",
+ },
};
// Create a tiny index, so tests above can verify documentation is fetched.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65655.213053.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190802/2921f08a/attachment.bin>
More information about the llvm-commits
mailing list