[PATCH] D73102: [clangd] Handle the missing injectedClassNameType in targetDecl.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 22 01:18:35 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5d4e89975714: [clangd] Handle the missing injectedClassNameType in targetDecl. (authored by hokein).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73102/new/
https://reviews.llvm.org/D73102
Files:
clang-tools-extra/clangd/FindTarget.cpp
clang-tools-extra/clangd/unittests/FindTargetTests.cpp
Index: clang-tools-extra/clangd/unittests/FindTargetTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/FindTargetTests.cpp
+++ clang-tools-extra/clangd/unittests/FindTargetTests.cpp
@@ -286,6 +286,14 @@
)cpp";
// FIXME: We don't do a good job printing TemplateTypeParmDecls, apparently!
EXPECT_DECLS("SizeOfPackExpr", "");
+
+ Code = R"cpp(
+ template <typename T>
+ class Foo {
+ void f([[Foo]] x);
+ };
+ )cpp";
+ EXPECT_DECLS("InjectedClassNameTypeLoc", "class Foo");
}
TEST_F(TargetDeclTest, ClassTemplate) {
Index: clang-tools-extra/clangd/FindTarget.cpp
===================================================================
--- clang-tools-extra/clangd/FindTarget.cpp
+++ clang-tools-extra/clangd/FindTarget.cpp
@@ -374,6 +374,11 @@
void VisitTagType(const TagType *TT) {
Outer.add(TT->getAsTagDecl(), Flags);
}
+
+ void VisitInjectedClassNameType(const InjectedClassNameType *ICNT) {
+ Outer.add(ICNT->getDecl(), Flags);
+ }
+
void VisitDecltypeType(const DecltypeType *DTT) {
Outer.add(DTT->getUnderlyingType(), Flags | Rel::Underlying);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73102.239508.patch
Type: text/x-patch
Size: 1205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200122/10e1db7c/attachment.bin>
More information about the cfe-commits
mailing list