diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-24 21:44:43 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-24 21:44:43 +0000 |
commit | 7c9442a6aefe268a7714d9ad7a94d6e15d6418f0 (patch) | |
tree | 693cf16ac6b45327c50caf6727069d3e062d5f93 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 2ce48056a4fada8a810bcefe09888e0e883ca878 (diff) | |
download | bcm5719-llvm-7c9442a6aefe268a7714d9ad7a94d6e15d6418f0.tar.gz bcm5719-llvm-7c9442a6aefe268a7714d9ad7a94d6e15d6418f0.zip |
PR22673 again: diagnose use of the used decl, not the found decl. This is also
wrong (DiagnoseUseOfDecl should take both), but it's more consistent with what
we do in other places.
llvm-svn: 230384
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 7a76f6ae765..0a6b0c85458 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2591,7 +2591,7 @@ static ExprResult BuildCXXCastArgument(Sema &S, S.CheckConstructorAccess(CastLoc, Constructor, InitializedEntity::InitializeTemporary(Ty), Constructor->getAccess()); - if (S.DiagnoseUseOfDecl(FoundDecl, CastLoc)) + if (S.DiagnoseUseOfDecl(Method, CastLoc)) return ExprError(); ExprResult Result = S.BuildCXXConstructExpr( @@ -2609,7 +2609,7 @@ static ExprResult BuildCXXCastArgument(Sema &S, assert(!From->getType()->isPointerType() && "Arg can't have pointer type!"); S.CheckMemberOperatorAccess(CastLoc, From, /*arg*/ nullptr, FoundDecl); - if (S.DiagnoseUseOfDecl(FoundDecl, CastLoc)) + if (S.DiagnoseUseOfDecl(Method, CastLoc)) return ExprError(); // Create an implicit call expr that calls it. |