Home | History | Annotate | Download | only in Sema

Lines Matching refs:Destructor

4307   // user might reasonably want to know why the destructor is being
4330 // The destructor for an implicit anonymous union member is never invoked.
4947 // Warn if the class has virtual methods but non-virtual public destructor.
5216 // A user-provided destructor can be defined outside the class. When that
5552 // As a weird special case, a destructor call from a union's constructor
5554 // destructor is never actually called, but is semantically checked as
5603 // -- any direct or virtual base class [...] has a type with a destructor
5613 // type with a destructor that is deleted or inaccessible
5774 // namespace scope, the constructor and destructor are used.
5828 // -- for a virtual destructor, lookup of the non-array deallocation function
5924 // A destructor is trivial if:
6212 // A [default constructor or destructor] is trivial if
6228 // A [default constructor or destructor] is trivial if
6231 // constructor or destructor]
6236 // A destructor is trivial if [...]
6237 // -- the destructor is not virtual
6446 /// constructor, or destructor, to the given C++ class (C++
6494 // If we have a dynamic class, then the destructor may be virtual, so we
6495 // have to declare the destructor immediately. This ensures that, e.g., it
6751 /// CheckDestructor - Checks a fully-formed destructor definition for
6754 bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
6755 CXXRecordDecl *RD = Destructor->getParent();
6757 if (!Destructor->getOperatorDelete() && Destructor->isVirtual()) {
6760 if (!Destructor->isImplicit())
6761 Loc = Destructor->getLocation();
6765 // If we have a virtual destructor, look up the deallocation function
6778 Destructor->setOperatorDelete(OperatorDelete);
6785 /// the well-formednes of the destructor declarator @p D with type @p
6788 /// will be updated to reflect a well-formed type for the destructor and
6795 // be used as the identifier in the declarator for a destructor
6808 // A destructor is used to destroy objects of its class type. A
6809 // destructor takes no parameters, and no return type can be
6810 // specified for it (not even void). The address of a destructor
6811 // shall not be taken. A destructor shall not be static. A
6812 // destructor can be invoked for a const, volatile or const
6813 // volatile object. A destructor shall not be declared const,
6863 // A destructor shall not be declared with a ref-qualifier.
6880 // Make sure the destructor isn't variadic.
9355 // If a class has no user-declared destructor, a destructor is
9356 // declared implicitly. An implicitly-declared destructor is an
9364 // Create the actual destructor declaration.
9371 CXXDestructorDecl *Destructor
9375 Destructor->setAccess(AS_public);
9376 Destructor->setDefaulted();
9380 Destructor,
9385 // Build an exception specification pointing back at this destructor.
9386 FunctionProtoType::ExtProtoInfo EPI = getImplicitMethodEPI(*this, Destructor);
9387 Destructor->setType(Context.getFunctionType(Context.VoidTy, None, EPI));
9389 AddOverriddenMethods(ClassDecl, Destructor);
9393 Destructor->setTrivial(ClassDecl->hasTrivialDestructor());
9395 if (ShouldDeleteSpecialMember(Destructor, CXXDestructor))
9396 SetDeclDeleted(Destructor, ClassLoc);
9398 // Note that we have declared this destructor.
9401 // Introduce this destructor into its scope.
9403 PushOnScopeChains(Destructor, S, false);
9404 ClassDecl->addDecl(Destructor);
9406 return Destructor;
9410 CXXDestructorDecl *Destructor) {
9411 assert((Destructor->isDefaulted() &&
9412 !Destructor->doesThisDeclarationHaveABody() &&
9413 !Destructor->isDeleted()) &&
9415 CXXRecordDecl *ClassDecl = Destructor->getParent();
9416 assert(ClassDecl && "DefineImplicitDestructor - invalid destructor");
9418 if (Destructor->isInvalidDecl())
9421 SynthesizedFunctionScope Scope(*this, Destructor);
9424 MarkBaseAndMemberDestructorsReferenced(Destructor->getLocation(),
9425 Destructor->getParent());
9427 if (CheckDestructor(Destructor) || Trap.hasErrorOccurred()) {
9431 Destructor->setInvalidDecl();
9438 Destructor->getType()->castAs<FunctionProtoType>());
9440 SourceLocation Loc = Destructor->getLocEnd().isValid()
9441 ? Destructor->getLocEnd()
9442 : Destructor->getLocation();
9443 Destructor->setBody(new (Context) CompoundStmt(Loc));
9444 Destructor->markUsed(Context);
9448 L->CompletedImplicitDefinition(Destructor);
9514 CXXDestructorDecl *Destructor) {
9519 // A declaration of a destructor that does not have an exception-
9522 const FunctionProtoType *DtorType = Destructor->getType()->
9527 // Replace the destructor's type, building off the existing one. Fortunately,
9528 // the only thing of interest in the destructor type is its extended info.
9532 EPI.ExceptionSpec.SourceDecl = Destructor;
9533 Destructor->setType(Context.getFunctionType(Context.VoidTy, None, EPI));
9535 // FIXME: If the destructor has a body that could throw, and the newly created
10099 /// copy assignment operator, or destructor.
10139 << /*destructor*/isa<CXXDestructorDecl>(UserDeclaredOperation);
10166 // user-declared destructor.
10936 // or a user-declared destructor.
11312 // copy/move constructor and/or destructor for the object have
11411 CXXDestructorDecl *Destructor = LookupDestructor(ClassDecl);
11412 MarkFunctionReferenced(VD->getLocation(), Destructor);
11413 CheckDestructorAccess(VD->getLocation(), Destructor,
11417 DiagnoseUseOfDecl(Destructor, VD->getLocation());
11419 if (Destructor->isTrivial()) return;
13206 // The Microsoft ABI requires that we perform the destructor body
13208 // the deleting destructor is emitted with the vtable, not with the
13209 // destructor definition as in the Itanium ABI.
13398 // Be sure that the destructor is accessible and is marked as referenced.
13403 if (CXXDestructorDecl *Destructor = LookupDestructor(RD)) {
13404 MarkFunctionReferenced(Field->getLocation(), Destructor);
13405 CheckDestructorAccess(Field->getLocation(), Destructor,