summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-15 22:33:43 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-15 22:33:43 +0000
commitb2ccf010fb5e4b382bad7c4ea906ac88509ced47 (patch)
tree9341de299319338ee4f3d92284e3bd317d0c3e8c /clang/lib/Sema/SemaDeclAttr.cpp
parentf7f97b4bbdf0cff78d95886953851aa17b64eb7b (diff)
downloadbcm5719-llvm-b2ccf010fb5e4b382bad7c4ea906ac88509ced47.tar.gz
bcm5719-llvm-b2ccf010fb5e4b382bad7c4ea906ac88509ced47.zip
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
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp5
1 files changed, 4 insertions, 1 deletions
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) <<
OpenPOWER on IntegriCloud