Lines Matching full:destructor
3571 // user might reasonably want to know why the destructor is being
3596 // The destructor for an implicit anonymous union member is never invoked.
4021 // Warn if the class has virtual methods but non-virtual public destructor.
4071 // destructor for the class is trivial.
4250 // A user-provided destructor can be defined outside the class. When that
4567 // As a weird special case, a destructor call from a union's constructor
4569 // destructor is never actually called, but is semantically checked as
4617 // -- any direct or virtual base class [...] has a type with a destructor
4626 // type with a destructor that is deleted or inaccessible
4789 // namespace scope, the constructor and destructor are used.
4845 // -- for a virtual destructor, lookup of the non-array deallocation function
4934 // A destructor is trivial if:
5232 // A [default constructor or destructor] is trivial if
5251 // A [default constructor or destructor] is trivial if
5254 // constructor or destructor]
5259 // A destructor is trivial if [...]
5260 // -- the destructor is not virtual
5445 /// constructor, or destructor, to the given C++ class (C++
5493 // If we have a dynamic class, then the destructor may be virtual, so we
5494 // have to declare the destructor immediately. This ensures that, e.g., it
5721 /// CheckDestructor - Checks a fully-formed destructor definition for
5724 bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
5725 CXXRecordDecl *RD = Destructor->getParent();
5727 if (Destructor->isVirtual()) {
5730 if (!Destructor->isImplicit())
5731 Loc = Destructor->getLocation();
5735 // If we have a virtual destructor, look up the deallocation function
5744 Destructor->setOperatorDelete(OperatorDelete);
5758 /// the well-formednes of the destructor declarator @p D with type @p
5761 /// will be updated to reflect a well-formed type for the destructor and
5768 // be used as the identifier in the declarator for a destructor
5781 // A destructor is used to destroy objects of its class type. A
5782 // destructor takes no parameters, and no return type can be
5783 // specified for it (not even void). The address of a destructor
5784 // shall not be taken. A destructor shall not be static. A
5785 // destructor can be invoked for a const, volatile or const
5786 // volatile object. A destructor shall not be declared const,
5826 // A destructor shall not be declared with a ref-qualifier.
5843 // Make sure the destructor isn't variadic.
7916 // If a class has no user-declared destructor, a destructor is
7917 // declared implicitly. An implicitly-declared destructor is an
7925 // Create the actual destructor declaration.
7932 CXXDestructorDecl *Destructor
7936 Destructor->setAccess(AS_public);
7937 Destructor->setDefaulted();
7938 Destructor->setImplicit();
7940 // Build an exception specification pointing back at this destructor.
7943 EPI.ExceptionSpecDecl = Destructor;
7944 Destructor->setType(Context.getFunctionType(Context.VoidTy,
7948 AddOverriddenMethods(ClassDecl, Destructor);
7952 Destructor->setTrivial(ClassDecl->hasTrivialDestructor());
7954 if (ShouldDeleteSpecialMember(Destructor, CXXDestructor))
7955 Destructor->setDeletedAsWritten();
7957 // Note that we have declared this destructor.
7960 // Introduce this destructor into its scope.
7962 PushOnScopeChains(Destructor, S, false);
7963 ClassDecl->addDecl(Destructor);
7965 return Destructor;
7969 CXXDestructorDecl *Destructor) {
7970 assert((Destructor->isDefaulted() &&
7971 !Destructor->doesThisDeclarationHaveABody() &&
7972 !Destructor->isDeleted()) &&
7974 CXXRecordDecl *ClassDecl = Destructor->getParent();
7975 assert(ClassDecl && "DefineImplicitDestructor - invalid destructor");
7977 if (Destructor->isInvalidDecl())
7980 SynthesizedFunctionScope Scope(*this, Destructor);
7983 MarkBaseAndMemberDestructorsReferenced(Destructor->getLocation(),
7984 Destructor->getParent());
7986 if (CheckDestructor(Destructor) || Trap.hasErrorOccurred()) {
7990 Destructor->setInvalidDecl();
7994 SourceLocation Loc = Destructor->getLocation();
7995 Destructor->setBody(new (Context) CompoundStmt(Loc));
7996 Destructor->setImplicitlyDefined(true);
7997 Destructor->setUsed();
8001 L->CompletedImplicitDefinition(Destructor);
8031 CXXDestructorDecl *Destructor) {
8036 // A declaration of a destructor that does not have an exception-
8039 const FunctionProtoType *DtorType = Destructor->getType()->
8044 // Replace the destructor's type, building off the existing one. Fortunately,
8045 // the only thing of interest in the destructor type is its extended info.
8049 EPI.ExceptionSpecDecl = Destructor;
8050 Destructor->setType(Context.getFunctionType(Context.VoidTy,
8054 // FIXME: If the destructor has a body that could throw, and the newly created
9657 // copy/move constructor and/or destructor for the object have
9704 CXXDestructorDecl *Destructor = LookupDestructor(ClassDecl);
9705 MarkFunctionReferenced(VD->getLocation(), Destructor);
9706 CheckDestructorAccess(VD->getLocation(), Destructor,
9710 DiagnoseUseOfDecl(Destructor, VD->getLocation());
11566 // Be sure that the destructor is accessible and is marked as referenced.
11571 if (CXXDestructorDecl *Destructor = LookupDestructor(RD)) {
11572 MarkFunctionReferenced(Field->getLocation(), Destructor);
11573 CheckDestructorAccess(Field->getLocation(), Destructor,