mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
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
This commit is contained in:
parent
2ce48056a4
commit
7c9442a6ae
@ -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.
|
||||
|
@ -87,3 +87,9 @@ int dc12 = use_dc({0}); // expected-error {{deleted}}
|
||||
int use_dcr(const DelCtor &); // expected-note {{here}}
|
||||
int dc13 = use_dcr(0); // expected-error {{deleted}}
|
||||
int dc14 = use_dcr({0}); // expected-error {{deleted}}
|
||||
|
||||
struct DelCtorTemplate {
|
||||
template<typename T> DelCtorTemplate(T) = delete; // expected-note {{deleted}}
|
||||
};
|
||||
int use_dct(const DelCtorTemplate &);
|
||||
int dc15 = use_dct(0); // expected-error {{deleted}}
|
||||
|
Loading…
Reference in New Issue
Block a user