summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/unittests/SelectionTests.cpp
diff options
context:
space:
mode:
authorKadir Cetinkaya <kadircet@google.com>2020-01-13 12:09:30 +0100
committerKadir Cetinkaya <kadircet@google.com>2020-01-13 20:33:13 +0100
commitf5465e74ef4c9e24f867002aa598dc9e6481ead3 (patch)
tree43afa24e997b473c31e02db121e6d013a6d36981 /clang-tools-extra/clangd/unittests/SelectionTests.cpp
parent15078d7202b410fd15eedc49d2ab2e4fe9a9f177 (diff)
downloadbcm5719-llvm-f5465e74ef4c9e24f867002aa598dc9e6481ead3.tar.gz
bcm5719-llvm-f5465e74ef4c9e24f867002aa598dc9e6481ead3.zip
[clangd] Include expression in DecltypeTypeLoc sourcerange while building SelectionTree
Summary: Currently AST only contains the location for `decltype` keyword, therefore we were skipping expressions inside decltype while building selection tree. This patch extends source range in such cases to contain the expression as well. A proper fix would require changes to Sema and DecltypeTypeLoc to contain these location information. Fixes https://github.com/clangd/clangd/issues/250. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72594
Diffstat (limited to 'clang-tools-extra/clangd/unittests/SelectionTests.cpp')
-rw-r--r--clang-tools-extra/clangd/unittests/SelectionTests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/unittests/SelectionTests.cpp b/clang-tools-extra/clangd/unittests/SelectionTests.cpp
index 9e1a90b55e3..581309b1dcc 100644
--- a/clang-tools-extra/clangd/unittests/SelectionTests.cpp
+++ b/clang-tools-extra/clangd/unittests/SelectionTests.cpp
@@ -323,6 +323,12 @@ TEST(SelectionTest, CommonAncestor) {
Foo x = [[^12_ud]];
)cpp",
"UserDefinedLiteral"},
+ {
+ R"cpp(
+ int a;
+ decltype([[^a]] + a) b;
+ )cpp",
+ "DeclRefExpr"},
};
for (const Case &C : Cases) {
Annotations Test(C.Code);
OpenPOWER on IntegriCloud