diff options
Diffstat (limited to 'iwyu.cc')
-rw-r--r-- | iwyu.cc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -3206,7 +3206,7 @@ class InstantiatedTemplateVisitor ast_node != caller_ast_node_; ast_node = ast_node->parent()) { if (preprocessor_info().PublicHeaderIntendsToProvide( GetFileEntry(ast_node->GetLocation()), - GetFileEntry(decl))) + GetFileEntry(decl->getLocation()))) return ast_node->GetLocation(); } return SourceLocation(); // an invalid source-loc @@ -3218,8 +3218,10 @@ class InstantiatedTemplateVisitor bool IsProvidedByTemplate(const Type* type) const { type = RemoveSubstTemplateTypeParm(type); type = RemovePointersAndReferences(type); // get down to the decl - if (const NamedDecl* decl = TypeToDeclAsWritten(type)) + if (const NamedDecl* decl = TypeToDeclAsWritten(type)) { + decl = GetDefinitionAsWritten(decl); return GetLocOfTemplateThatProvides(decl).isValid(); + } return true; // we always provide non-decl types like int, etc. } |