• Home
  • Raw
  • Download

Lines Matching refs:MD

470         CXXMethodDecl* MD = dyn_cast<CXXMethodDecl>(New);  in MergeCXXFunctionDecl()  local
471 if (MD && MD->getParent()->getDescribedClassTemplate()) { in MergeCXXFunctionDecl()
758 const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(NewFD); in CheckConstexprFunctionDecl() local
759 if (MD && MD->isInstance()) { in CheckConstexprFunctionDecl()
764 const CXXRecordDecl *RD = MD->getParent(); in CheckConstexprFunctionDecl()
1830 CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D); in CheckOverrideControl() local
1833 if (MD && MD->isInstance() && in CheckOverrideControl()
1834 (MD->getParent()->hasAnyDependentBases() || in CheckOverrideControl()
1835 MD->getType()->isDependentType())) in CheckOverrideControl()
1838 if (MD && !MD->isVirtual()) { in CheckOverrideControl()
1842 FindHiddenVirtualMethods(MD, OverloadedMethods); in CheckOverrideControl()
1855 NoteHiddenVirtualMethods(MD, OverloadedMethods); in CheckOverrideControl()
1856 MD->setInvalidDecl(); in CheckOverrideControl()
1863 if (!MD || !MD->isVirtual()) { in CheckOverrideControl()
1885 MD->begin_overridden_methods() != MD->end_overridden_methods(); in CheckOverrideControl()
1886 if (MD->hasAttr<OverrideAttr>() && !HasOverriddenMethods) in CheckOverrideControl()
1887 Diag(MD->getLocation(), diag::err_function_marked_override_not_overriding) in CheckOverrideControl()
1888 << MD->getDeclName(); in CheckOverrideControl()
2172 if (CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(Member)) in ActOnCXXMemberDeclarator() local
2173 MD->setRangeEnd(VS.getLastLocation()); in ActOnCXXMemberDeclarator()
4366 CXXMethodDecl *MD) { in CheckAbstractClassUsage() argument
4369 if (MD->doesThisDeclarationHaveABody()) in CheckAbstractClassUsage()
4375 if (TypeSourceInfo *TSI = MD->getTypeSourceInfo()) in CheckAbstractClassUsage()
4376 Info.CheckType(MD, TSI->getTypeLoc(), Sema::AbstractNone); in CheckAbstractClassUsage()
4428 CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Member); in checkDLLAttribute() local
4431 if (!VD && !MD) in checkDLLAttribute()
4435 if (MD && MD->isDeleted()) in checkDLLAttribute()
4438 if (MD && MD->isMoveAssignmentOperator() && !ClassExported && in checkDLLAttribute()
4439 MD->isInlined()) { in checkDLLAttribute()
4462 if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Member)) { in checkDLLAttribute() local
4464 if (MD->isUserProvided()) { in checkDLLAttribute()
4466 S.MarkFunctionReferenced(Class->getLocation(), MD); in checkDLLAttribute()
4467 } else if (!MD->isTrivial() || MD->isExplicitlyDefaulted() || in checkDLLAttribute()
4468 MD->isCopyAssignmentOperator() || in checkDLLAttribute()
4469 MD->isMoveAssignmentOperator()) { in checkDLLAttribute()
4472 S.MarkFunctionReferenced(Class->getLocation(), MD); in checkDLLAttribute()
4474 auto *FPT = MD->getType()->getAs<FunctionProtoType>(); in checkDLLAttribute()
4476 S.ActOnFinishInlineMethodDef(MD); in checkDLLAttribute()
4791 computeImplicitExceptionSpec(Sema &S, SourceLocation Loc, CXXMethodDecl *MD) { in computeImplicitExceptionSpec() argument
4792 switch (S.getSpecialMember(MD)) { in computeImplicitExceptionSpec()
4794 return S.ComputeDefaultedDefaultCtorExceptionSpec(Loc, MD); in computeImplicitExceptionSpec()
4796 return S.ComputeDefaultedCopyCtorExceptionSpec(MD); in computeImplicitExceptionSpec()
4798 return S.ComputeDefaultedCopyAssignmentExceptionSpec(MD); in computeImplicitExceptionSpec()
4800 return S.ComputeDefaultedMoveCtorExceptionSpec(MD); in computeImplicitExceptionSpec()
4802 return S.ComputeDefaultedMoveAssignmentExceptionSpec(MD); in computeImplicitExceptionSpec()
4804 return S.ComputeDefaultedDtorExceptionSpec(MD); in computeImplicitExceptionSpec()
4808 assert(cast<CXXConstructorDecl>(MD)->getInheritedConstructor() && in computeImplicitExceptionSpec()
4810 return S.ComputeInheritingCtorExceptionSpec(cast<CXXConstructorDecl>(MD)); in computeImplicitExceptionSpec()
4814 CXXMethodDecl *MD) { in getImplicitMethodEPI() argument
4819 EPI.ExceptionSpecDecl = MD; in getImplicitMethodEPI()
4828 void Sema::EvaluateImplicitExceptionSpec(SourceLocation Loc, CXXMethodDecl *MD) { in EvaluateImplicitExceptionSpec() argument
4829 const FunctionProtoType *FPT = MD->getType()->castAs<FunctionProtoType>(); in EvaluateImplicitExceptionSpec()
4835 computeImplicitExceptionSpec(*this, Loc, MD); in EvaluateImplicitExceptionSpec()
4841 UpdateExceptionSpec(MD, EPI); in EvaluateImplicitExceptionSpec()
4847 MD->getCanonicalDecl()->getType()->castAs<FunctionProtoType>(); in EvaluateImplicitExceptionSpec()
4849 UpdateExceptionSpec(MD->getCanonicalDecl(), EPI); in EvaluateImplicitExceptionSpec()
4852 void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) { in CheckExplicitlyDefaultedSpecialMember() argument
4853 CXXRecordDecl *RD = MD->getParent(); in CheckExplicitlyDefaultedSpecialMember()
4854 CXXSpecialMember CSM = getSpecialMember(MD); in CheckExplicitlyDefaultedSpecialMember()
4856 assert(MD->isExplicitlyDefaulted() && CSM != CXXInvalid && in CheckExplicitlyDefaultedSpecialMember()
4861 bool First = MD == MD->getCanonicalDecl(); in CheckExplicitlyDefaultedSpecialMember()
4875 if (MD->getNumParams() != ExpectedParams) { in CheckExplicitlyDefaultedSpecialMember()
4879 Diag(MD->getLocation(), diag::err_defaulted_special_member_params) in CheckExplicitlyDefaultedSpecialMember()
4880 << CSM << MD->getSourceRange(); in CheckExplicitlyDefaultedSpecialMember()
4882 } else if (MD->isVariadic()) { in CheckExplicitlyDefaultedSpecialMember()
4883 Diag(MD->getLocation(), diag::err_defaulted_special_member_variadic) in CheckExplicitlyDefaultedSpecialMember()
4884 << CSM << MD->getSourceRange(); in CheckExplicitlyDefaultedSpecialMember()
4888 const FunctionProtoType *Type = MD->getType()->getAs<FunctionProtoType>(); in CheckExplicitlyDefaultedSpecialMember()
4903 Diag(MD->getLocation(), diag::err_defaulted_special_member_return_type) in CheckExplicitlyDefaultedSpecialMember()
4910 Diag(MD->getLocation(), diag::err_defaulted_special_member_quals) in CheckExplicitlyDefaultedSpecialMember()
4925 Diag(MD->getLocation(), in CheckExplicitlyDefaultedSpecialMember()
4932 Diag(MD->getLocation(), in CheckExplicitlyDefaultedSpecialMember()
4937 Diag(MD->getLocation(), in CheckExplicitlyDefaultedSpecialMember()
4947 Diag(MD->getLocation(), diag::err_defaulted_copy_assign_not_ref); in CheckExplicitlyDefaultedSpecialMember()
4960 if ((getLangOpts().CPlusPlus1y ? !isa<CXXDestructorDecl>(MD) in CheckExplicitlyDefaultedSpecialMember()
4961 : isa<CXXConstructorDecl>(MD)) && in CheckExplicitlyDefaultedSpecialMember()
4962 MD->isConstexpr() && !Constexpr && in CheckExplicitlyDefaultedSpecialMember()
4963 MD->getTemplatedKind() == FunctionDecl::TK_NonTemplate) { in CheckExplicitlyDefaultedSpecialMember()
4964 Diag(MD->getLocStart(), diag::err_incorrect_defaulted_constexpr) << CSM; in CheckExplicitlyDefaultedSpecialMember()
4978 InstantiateExceptionSpec(MD->getLocStart(), MD); in CheckExplicitlyDefaultedSpecialMember()
4979 Type = MD->getType()->getAs<FunctionProtoType>(); in CheckExplicitlyDefaultedSpecialMember()
4981 DelayedDefaultedMemberExceptionSpecs.push_back(std::make_pair(MD, Type)); in CheckExplicitlyDefaultedSpecialMember()
4983 CheckExplicitlyDefaultedMemberExceptionSpec(MD, Type); in CheckExplicitlyDefaultedSpecialMember()
4990 MD->setConstexpr(Constexpr); in CheckExplicitlyDefaultedSpecialMember()
4996 EPI.ExceptionSpecDecl = MD; in CheckExplicitlyDefaultedSpecialMember()
4997 MD->setType(Context.getFunctionType(ReturnType, in CheckExplicitlyDefaultedSpecialMember()
5003 if (ShouldDeleteSpecialMember(MD, CSM)) { in CheckExplicitlyDefaultedSpecialMember()
5005 SetDeclDeleted(MD, MD->getLocation()); in CheckExplicitlyDefaultedSpecialMember()
5010 Diag(MD->getLocation(), diag::err_out_of_line_default_deletes) << CSM; in CheckExplicitlyDefaultedSpecialMember()
5011 ShouldDeleteSpecialMember(MD, CSM, /*Diagnose*/true); in CheckExplicitlyDefaultedSpecialMember()
5017 MD->setInvalidDecl(); in CheckExplicitlyDefaultedSpecialMember()
5025 CXXMethodDecl *MD, const FunctionProtoType *SpecifiedType) { in CheckExplicitlyDefaultedMemberExceptionSpec() argument
5030 computeImplicitExceptionSpec(*this, MD->getLocation(), MD).getEPI(EPI); in CheckExplicitlyDefaultedMemberExceptionSpec()
5037 << getSpecialMember(MD), PDiag(), in CheckExplicitlyDefaultedMemberExceptionSpec()
5039 SpecifiedType, MD->getLocation()); in CheckExplicitlyDefaultedMemberExceptionSpec()
5069 CXXMethodDecl *MD; member
5079 SpecialMemberDeletionInfo(Sema &S, CXXMethodDecl *MD, in SpecialMemberDeletionInfo()
5081 : S(S), MD(MD), CSM(CSM), Diagnose(Diagnose), in SpecialMemberDeletionInfo()
5083 ConstArg(false), Loc(MD->getLocation()), in SpecialMemberDeletionInfo()
5107 if (MD->getNumParams()) { in SpecialMemberDeletionInfo()
5109 MD->getParamDecl(0)->getType()->getAs<ReferenceType>()) in SpecialMemberDeletionInfo()
5114 bool inUnion() const { return MD->getParent()->isUnion(); } in inUnion()
5148 objectTy = S.Context.getTypeDeclType(MD->getParent()); in isAccessible()
5192 << CSM << MD->getParent() << /*IsField*/true in shouldDeleteForSubobjectCall()
5198 << CSM << MD->getParent() << /*IsField*/false in shouldDeleteForSubobjectCall()
5270 << MD->getParent() << FD << FieldType << /*Reference*/0; in shouldDeleteForField()
5282 << MD->getParent() << FD << FD->getType() << /*Const*/1; in shouldDeleteForField()
5294 << MD->getParent() << FD << FieldType; in shouldDeleteForField()
5302 << IsMove << MD->getParent() << FD << FieldType << /*Reference*/0; in shouldDeleteForField()
5310 << IsMove << MD->getParent() << FD << FD->getType() << /*Const*/1; in shouldDeleteForField()
5341 << MD->getParent() << /*anonymous union*/1; in shouldDeleteForField()
5365 !MD->getParent()->field_empty()) { in shouldDeleteForAllConstMembers()
5367 S.Diag(MD->getParent()->getLocation(), in shouldDeleteForAllConstMembers()
5369 << MD->getParent() << /*not anonymous union*/0; in shouldDeleteForAllConstMembers()
5378 bool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, in ShouldDeleteSpecialMember() argument
5380 if (MD->isInvalidDecl()) in ShouldDeleteSpecialMember()
5382 CXXRecordDecl *RD = MD->getParent(); in ShouldDeleteSpecialMember()
5409 if (MD->isImplicit() && in ShouldDeleteSpecialMember()
5451 ContextRAII MethodContext(*this, MD); in ShouldDeleteSpecialMember()
5456 if (CSM == CXXDestructor && MD->isVirtual()) { in ShouldDeleteSpecialMember()
5460 if (FindDeallocationFunction(MD->getLocation(), MD->getParent(), Name, in ShouldDeleteSpecialMember()
5468 SpecialMemberDeletionInfo SMI(*this, MD, CSM, Diagnose); in ShouldDeleteSpecialMember()
5758 bool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, in SpecialMemberIsTrivial() argument
5760 assert(!MD->isUserProvided() && CSM != CXXInvalid && "not special enough"); in SpecialMemberIsTrivial()
5762 CXXRecordDecl *RD = MD->getParent(); in SpecialMemberIsTrivial()
5779 const ParmVarDecl *Param0 = MD->getParamDecl(0); in SpecialMemberIsTrivial()
5795 const ParmVarDecl *Param0 = MD->getParamDecl(0); in SpecialMemberIsTrivial()
5812 if (MD->getMinRequiredArguments() < MD->getNumParams()) { in SpecialMemberIsTrivial()
5814 Diag(MD->getParamDecl(MD->getMinRequiredArguments())->getLocation(), in SpecialMemberIsTrivial()
5816 << MD->getParamDecl(MD->getMinRequiredArguments())->getSourceRange(); in SpecialMemberIsTrivial()
5819 if (MD->isVariadic()) { in SpecialMemberIsTrivial()
5821 Diag(MD->getLocation(), diag::note_nontrivial_variadic); in SpecialMemberIsTrivial()
5857 if (CSM == CXXDestructor && MD->isVirtual()) { in SpecialMemberIsTrivial()
5859 Diag(MD->getLocation(), diag::note_nontrivial_virtual_dtor) << RD; in SpecialMemberIsTrivial()
5866 if (CSM != CXXDestructor && MD->getParent()->isDynamicClass()) { in SpecialMemberIsTrivial()
5906 static bool CheckMostOverridenMethods(const CXXMethodDecl *MD, in CheckMostOverridenMethods() argument
5908 if (MD->size_overridden_methods() == 0) in CheckMostOverridenMethods()
5909 return Methods.count(MD->getCanonicalDecl()); in CheckMostOverridenMethods()
5910 for (CXXMethodDecl::method_iterator I = MD->begin_overridden_methods(), in CheckMostOverridenMethods()
5911 E = MD->end_overridden_methods(); in CheckMostOverridenMethods()
5938 if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) { in FindHiddenVirtualMethod() local
5939 MD = MD->getCanonicalDecl(); in FindHiddenVirtualMethod()
5942 if (!MD->isVirtual()) in FindHiddenVirtualMethod()
5946 if (!Data.S->IsOverload(Data.Method, MD, false)) in FindHiddenVirtualMethod()
5949 if (!CheckMostOverridenMethods(MD, Data.OverridenAndUsingBaseMethods)) in FindHiddenVirtualMethod()
5950 overloadedMethods.push_back(MD); in FindHiddenVirtualMethod()
5961 static void AddMostOverridenMethods(const CXXMethodDecl *MD, in AddMostOverridenMethods() argument
5963 if (MD->size_overridden_methods() == 0) in AddMostOverridenMethods()
5964 Methods.insert(MD->getCanonicalDecl()); in AddMostOverridenMethods()
5965 for (CXXMethodDecl::method_iterator I = MD->begin_overridden_methods(), in AddMostOverridenMethods()
5966 E = MD->end_overridden_methods(); in AddMostOverridenMethods()
5973 void Sema::FindHiddenVirtualMethods(CXXMethodDecl *MD, in FindHiddenVirtualMethods() argument
5975 if (!MD->getDeclName().isIdentifier()) in FindHiddenVirtualMethods()
5982 Data.Method = MD; in FindHiddenVirtualMethods()
5987 CXXRecordDecl *DC = MD->getParent(); in FindHiddenVirtualMethods()
5988 DeclContext::lookup_result R = DC->lookup(MD->getDeclName()); in FindHiddenVirtualMethods()
5993 if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(ND)) in FindHiddenVirtualMethods() local
5994 AddMostOverridenMethods(MD, Data.OverridenAndUsingBaseMethods); in FindHiddenVirtualMethods()
6001 void Sema::NoteHiddenVirtualMethods(CXXMethodDecl *MD, in NoteHiddenVirtualMethods() argument
6007 HandleFunctionTypeMismatch(PD, MD->getType(), overloadedMD->getType()); in NoteHiddenVirtualMethods()
6014 void Sema::DiagnoseHiddenVirtualMethods(CXXMethodDecl *MD) { in DiagnoseHiddenVirtualMethods() argument
6015 if (MD->isInvalidDecl()) in DiagnoseHiddenVirtualMethods()
6018 if (Diags.isIgnored(diag::warn_overloaded_virtual, MD->getLocation())) in DiagnoseHiddenVirtualMethods()
6022 FindHiddenVirtualMethods(MD, OverloadedMethods); in DiagnoseHiddenVirtualMethods()
6024 Diag(MD->getLocation(), diag::warn_overloaded_virtual) in DiagnoseHiddenVirtualMethods()
6025 << MD << (OverloadedMethods.size() > 1); in DiagnoseHiddenVirtualMethods()
6027 NoteHiddenVirtualMethods(MD, OverloadedMethods); in DiagnoseHiddenVirtualMethods()
8243 CXXMethodDecl *MD) { in ComputeDefaultedDefaultCtorExceptionSpec() argument
8244 CXXRecordDecl *ClassDecl = MD->getParent(); in ComputeDefaultedDefaultCtorExceptionSpec()
8300 Diag(Loc, diag::err_in_class_initializer_references_def_ctor) << MD; in ComputeDefaultedDefaultCtorExceptionSpec()
8838 Sema::ComputeDefaultedDtorExceptionSpec(CXXMethodDecl *MD) { in ComputeDefaultedDtorExceptionSpec() argument
8839 CXXRecordDecl *ClassDecl = MD->getParent(); in ComputeDefaultedDtorExceptionSpec()
9431 Sema::ComputeDefaultedCopyAssignmentExceptionSpec(CXXMethodDecl *MD) { in ComputeDefaultedCopyAssignmentExceptionSpec() argument
9432 CXXRecordDecl *ClassDecl = MD->getParent(); in ComputeDefaultedCopyAssignmentExceptionSpec()
9438 const FunctionProtoType *T = MD->getType()->castAs<FunctionProtoType>(); in ComputeDefaultedCopyAssignmentExceptionSpec()
9815 Sema::ComputeDefaultedMoveAssignmentExceptionSpec(CXXMethodDecl *MD) { in ComputeDefaultedMoveAssignmentExceptionSpec() argument
9816 CXXRecordDecl *ClassDecl = MD->getParent(); in ComputeDefaultedMoveAssignmentExceptionSpec()
10237 Sema::ComputeDefaultedCopyCtorExceptionSpec(CXXMethodDecl *MD) { in ComputeDefaultedCopyCtorExceptionSpec() argument
10238 CXXRecordDecl *ClassDecl = MD->getParent(); in ComputeDefaultedCopyCtorExceptionSpec()
10244 const FunctionProtoType *T = MD->getType()->castAs<FunctionProtoType>(); in ComputeDefaultedCopyCtorExceptionSpec()
10393 Sema::ComputeDefaultedMoveCtorExceptionSpec(CXXMethodDecl *MD) { in ComputeDefaultedMoveCtorExceptionSpec() argument
10394 CXXRecordDecl *ClassDecl = MD->getParent(); in ComputeDefaultedMoveCtorExceptionSpec()
12155 if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Fn)) { in SetDeclDeleted() local
12157 for (CXXMethodDecl::method_iterator I = MD->begin_overridden_methods(), in SetDeclDeleted()
12158 E = MD->end_overridden_methods(); in SetDeclDeleted()
12160 if (!(*MD->begin_overridden_methods())->isDeleted()) { in SetDeclDeleted()
12162 Diag(DelLoc, diag::err_deleted_override) << MD->getDeclName(); in SetDeclDeleted()
12179 CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(Dcl); in SetDeclDefaulted() local
12181 if (MD) { in SetDeclDefaulted()
12182 if (MD->getParent()->isDependentType()) { in SetDeclDefaulted()
12183 MD->setDefaulted(); in SetDeclDefaulted()
12184 MD->setExplicitlyDefaulted(); in SetDeclDefaulted()
12188 CXXSpecialMember Member = getSpecialMember(MD); in SetDeclDefaulted()
12190 if (!MD->isInvalidDecl()) in SetDeclDefaulted()
12195 MD->setDefaulted(); in SetDeclDefaulted()
12196 MD->setExplicitlyDefaulted(); in SetDeclDefaulted()
12200 const FunctionDecl *Primary = MD; in SetDeclDefaulted()
12201 if (const FunctionDecl *Pattern = MD->getTemplateInstantiationPattern()) in SetDeclDefaulted()
12212 CheckExplicitlyDefaultedSpecialMember(MD); in SetDeclDefaulted()
12217 MD->getType()->castAs<FunctionProtoType>()); in SetDeclDefaulted()
12219 if (MD->isInvalidDecl()) in SetDeclDefaulted()
12225 cast<CXXConstructorDecl>(MD)); in SetDeclDefaulted()
12228 DefineImplicitCopyConstructor(DefaultLoc, cast<CXXConstructorDecl>(MD)); in SetDeclDefaulted()
12231 DefineImplicitCopyAssignment(DefaultLoc, MD); in SetDeclDefaulted()
12234 DefineImplicitDestructor(DefaultLoc, cast<CXXDestructorDecl>(MD)); in SetDeclDefaulted()
12237 DefineImplicitMoveConstructor(DefaultLoc, cast<CXXConstructorDecl>(MD)); in SetDeclDefaulted()
12240 DefineImplicitMoveAssignment(DefaultLoc, MD); in SetDeclDefaulted()