diff options
author | Fangrui Song <maskray@google.com> | 2018-07-09 21:49:06 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-07-09 21:49:06 +0000 |
commit | d50f36ed7731de6f7238c2f5f69b5769e311bb41 (patch) | |
tree | 6504eea14478ea65964f997d763c74b284c750ec /clang/lib/Index/IndexDecl.cpp | |
parent | 4fee1356edad7075195ad11810adf25f2bcb1f27 (diff) | |
download | bcm5719-llvm-d50f36ed7731de6f7238c2f5f69b5769e311bb41.tar.gz bcm5719-llvm-d50f36ed7731de6f7238c2f5f69b5769e311bb41.zip |
[Index] Add index::IndexingOptions::IndexImplicitInstantiation
Summary:
With IndexImplicitInstantiation=true, the following case records an occurrence of B::bar in A::foo, which will benefit cross reference tools.
template <class T> struct B { void bar() {}};
template <class T> struct A { void foo(B<T> *x) { x->bar(); }};
int main() { A<int> a; a.foo(0); }
Reviewers: akyrtzi, arphaman, rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D49002
llvm-svn: 336606
Diffstat (limited to 'clang/lib/Index/IndexDecl.cpp')
-rw-r--r-- | clang/lib/Index/IndexDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Index/IndexDecl.cpp b/clang/lib/Index/IndexDecl.cpp index 01608d2b77f..01ad3a27721 100644 --- a/clang/lib/Index/IndexDecl.cpp +++ b/clang/lib/Index/IndexDecl.cpp @@ -726,7 +726,7 @@ bool IndexingContext::indexDecl(const Decl *D) { if (D->isImplicit() && shouldIgnoreIfImplicit(D)) return true; - if (isTemplateImplicitInstantiation(D)) + if (isTemplateImplicitInstantiation(D) && !shouldIndexImplicitInstantiation()) return true; IndexingDeclVisitor Visitor(*this); |