summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-05-11 22:20:10 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-05-11 22:20:10 +0000
commit7d847b1ec1a0578af378e0bf4c655d3ba404670f (patch)
treecf40e5f815b3fbf8d1e3990f637fa1f70e0bdde3 /clang/lib/Sema/SemaExprCXX.cpp
parentd8735089753bd5e2d734957b2bce86c96ed58061 (diff)
downloadbcm5719-llvm-7d847b1ec1a0578af378e0bf4c655d3ba404670f.tar.gz
bcm5719-llvm-7d847b1ec1a0578af378e0bf4c655d3ba404670f.zip
When diagnosing inaccessible temporary destructors in decltype expressions, use
the correct type and the correct source location in the diagnostic. Spotted by Johannes Schaub! llvm-svn: 156654
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 7d987afe08e..c0ba2d6cf8a 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud