Lines Matching refs:Destructor
3286 // user might reasonably want to know why the destructor is being
3311 // The destructor for an implicit anonymous union member is never invoked.
3721 // Warn if the class has virtual methods but non-virtual public destructor.
4295 // Whether this was the first-declared instance of the destructor.
4450 // As a weird special case, a destructor call from a union's constructor
4452 // destructor is never actually called, but is semantically checked as
4500 // -- any direct or virtual base class [...] has a type with a destructor
4509 // type with a destructor that is deleted or inaccessible
4669 // namespace scope, the constructor and destructor are used.
4709 // -- for a virtual destructor, lookup of the non-array deallocation function
4864 /// constructor, or destructor, to the given C++ class (C++
4899 // If we have a dynamic class, then the destructor may be virtual, so we
4900 // have to declare the destructor immediately. This ensures that, e.g., it
5127 /// CheckDestructor - Checks a fully-formed destructor definition for
5130 bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
5131 CXXRecordDecl *RD = Destructor->getParent();
5133 if (Destructor->isVirtual()) {
5136 if (!Destructor->isImplicit())
5137 Loc = Destructor->getLocation();
5141 // If we have a virtual destructor, look up the deallocation function
5150 Destructor->setOperatorDelete(OperatorDelete);
5164 /// the well-formednes of the destructor declarator @p D with type @p
5167 /// will be updated to reflect a well-formed type for the destructor and
5174 // be used as the identifier in the declarator for a destructor
5187 // A destructor is used to destroy objects of its class type. A
5188 // destructor takes no parameters, and no return type can be
5189 // specified for it (not even void). The address of a destructor
5190 // shall not be taken. A destructor shall not be static. A
5191 // destructor can be invoked for a const, volatile or const
5192 // volatile object. A destructor shall not be declared const,
5232 // A destructor shall not be declared with a ref-qualifier.
5249 // Make sure the destructor isn't variadic.
7238 // If a class has no user-declared destructor, a destructor is
7239 // declared implicitly. An implicitly-declared destructor is an
7246 // Create the actual destructor declaration.
7255 CXXDestructorDecl *Destructor
7259 Destructor->setAccess(AS_public);
7260 Destructor->setDefaulted();
7261 Destructor->setImplicit();
7262 Destructor->setTrivial(ClassDecl->hasTrivialDestructor());
7264 // Note that we have declared this destructor.
7267 // Introduce this destructor into its scope.
7269 PushOnScopeChains(Destructor, S, false);
7270 ClassDecl->addDecl(Destructor);
7273 Destructor->setTypeSourceInfo(Context.getTrivialTypeSourceInfo(Ty));
7275 AddOverriddenMethods(ClassDecl, Destructor);
7277 if (ShouldDeleteSpecialMember(Destructor, CXXDestructor))
7278 Destructor->setDeletedAsWritten();
7280 return Destructor;
7284 CXXDestructorDecl *Destructor) {
7285 assert((Destructor->isDefaulted() &&
7286 !Destructor->doesThisDeclarationHaveABody() &&
7287 !Destructor->isDeleted()) &&
7289 CXXRecordDecl *ClassDecl = Destructor->getParent();
7290 assert(ClassDecl && "DefineImplicitDestructor - invalid destructor");
7292 if (Destructor->isInvalidDecl())
7295 ImplicitlyDefinedFunctionScope Scope(*this, Destructor);
7298 MarkBaseAndMemberDestructorsReferenced(Destructor->getLocation(),
7299 Destructor->getParent());
7301 if (CheckDestructor(Destructor) || Trap.hasErrorOccurred()) {
7305 Destructor->setInvalidDecl();
7309 SourceLocation Loc = Destructor->getLocation();
7310 Destructor->setBody(new (Context) CompoundStmt(Context, 0, 0, Loc, Loc));
7311 Destructor->setImplicitlyDefined(true);
7312 Destructor->setUsed();
7316 L->CompletedImplicitDefinition(Destructor);
7321 CXXDestructorDecl *destructor) {
7323 // A declaration of a destructor that does not have an exception-
7326 const FunctionProtoType *dtorType = destructor->getType()->
7334 // Replace the destructor's type, building off the existing one. Fortunately,
7335 // the only thing of interest in the destructor type is its extended info.
7343 destructor->setType(ty);
7345 // FIXME: If the destructor has a body that could throw, and the newly created
9103 // copy/move constructor and/or destructor for the object have
9179 CXXDestructorDecl *Destructor = LookupDestructor(ClassDecl);
9180 MarkFunctionReferenced(VD->getLocation(), Destructor);
9181 CheckDestructorAccess(VD->getLocation(), Destructor,
9185 DiagnoseUseOfDecl(Destructor, VD->getLocation());
10961 // Be sure that the destructor is accessible and is marked as referenced.
10966 if (CXXDestructorDecl *Destructor = LookupDestructor(RD)) {
10967 MarkFunctionReferenced(Field->getLocation(), Destructor);
10968 CheckDestructorAccess(Field->getLocation(), Destructor,