diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-11 22:20:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-05-11 22:20:10 +0000 |
commit | 2f68ca09ca8b5944fcab14578a161511afde406f (patch) | |
tree | 6623d78b2ba2ebb9205f0f33241368a6b948f217 /lib/Sema/SemaExprCXX.cpp | |
parent | e2c60667d1bc29b7e148f9c9828dcbdbfc5b82b0 (diff) |
When diagnosing inaccessible temporary destructors in decltype expressions, use
the correct type and the correct source location in the diagnostic. Spotted by
Johannes Schaub!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 7d987afe08..c0ba2d6cf8 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -4775,11 +4775,11 @@ ExprResult Sema::ActOnDecltypeExpression(Expr *E) { CXXDestructorDecl *Destructor = LookupDestructor(RD); Temp->setDestructor(Destructor); - MarkFunctionReferenced(E->getExprLoc(), Destructor); - CheckDestructorAccess(E->getExprLoc(), Destructor, + MarkFunctionReferenced(Bind->getExprLoc(), Destructor); + CheckDestructorAccess(Bind->getExprLoc(), Destructor, PDiag(diag::err_access_dtor_temp) - << E->getType()); - DiagnoseUseOfDecl(Destructor, E->getExprLoc()); + << Bind->getType()); + DiagnoseUseOfDecl(Destructor, Bind->getExprLoc()); // We need a cleanup, but we don't need to remember the temporary. ExprNeedsCleanups = true; |