From b2ccf010fb5e4b382bad7c4ea906ac88509ced47 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 15 Apr 2010 22:33:43 +0000 Subject: Feed proper source-location information into Sema::LookupSingleResult, in case it ends up doing something that might trigger diagnostics (template instantiation, ambiguity reporting, access reporting). Noticed while working on PR6831. llvm-svn: 101412 --- clang/lib/Sema/SemaDeclAttr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaDeclAttr.cpp') diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index bf54d2fea71..6a1451a4c6c 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1025,8 +1025,11 @@ static void HandleCleanupAttr(Decl *d, const AttributeList &Attr, Sema &S) { } // Look up the function + // FIXME: Lookup probably isn't looking in the right place + // FIXME: The lookup source location should be in the attribute, not the + // start of the attribute. NamedDecl *CleanupDecl - = S.LookupSingleName(S.TUScope, Attr.getParameterName(), + = S.LookupSingleName(S.TUScope, Attr.getParameterName(), Attr.getLoc(), Sema::LookupOrdinaryName); if (!CleanupDecl) { S.Diag(Attr.getLoc(), diag::err_attribute_cleanup_arg_not_found) << -- cgit v1.2.3