Lines Matching refs:Constructor
526 // libstdc++4.6 marks the vector default constructor as explicit in
718 // Empty initialization requires a constructor call, so
719 // extend the initializer list to include the constructor
915 // Empty initialization requires a constructor call, so
916 // extend the initializer list to include the constructor
1256 // Don't warn if there's an equivalent default constructor that would be
3683 DeclAccessPair FoundDecl, CXXConstructorDecl *Constructor, QualType T,
3691 S.Function.Function = Constructor;
3869 /// When initializing from init list via constructor, handle
3905 /// Determine if the constructor has the signature of a copy or move
3906 /// constructor for the type T of the class in which it was found. That is,
3911 if (Info.Constructor->getNumParams() == 0)
3915 Info.Constructor->getParamDecl(0)->getType().getNonReferenceType();
3937 if (!Info.Constructor || Info.Constructor->isInvalidDecl())
3940 if (OnlyListConstructors && !S.isInitListConstructor(Info.Constructor))
3944 // ... and the constructor or user-defined conversion function is a
3951 // the first parameter of a constructor of class X, and the conversion
3967 // of a constructor [for type T] that takes a reference to possibly
3971 // FIXME: What if a constructor template instantiates to such a signature?
3975 S.AddOverloadCandidate(Info.Constructor, Info.FoundDecl, Args,
3984 // When initializing an object of class type T by constructor
4029 /// Attempt initialization by constructor (C++ [dcl.init]), which
4068 // class or delegating to another constructor from a mem-initializer.
4086 assert(DestRecordType && "Constructor initialization requires record type");
4112 // the constructor in two phases:
4120 // If the initializer list has no elements and T has a default constructor,
4131 // - If no viable initializer-list constructor is found, overload resolution
4156 // instead of a constructor.
4176 // user-provided default constructor.
4178 // If the implicit default constructor initializes all subobjects, no
4192 // In copy-list-initialization, if an explicit constructor is chosen, the
4211 // Add the constructor initialization step. Any cv-qualification conversion is
4437 // class type with a default constructor, the object is
4574 // [over.match.ref] permit an explicit constructor to be chosen when
4588 if (!Info.Constructor)
4591 if (!Info.Constructor->isInvalidDecl() &&
4592 Info.Constructor->isConvertingConstructor(/*AllowExplicit*/true)) {
4601 Info.Constructor, Info.FoundDecl, Initializer, CandidateSet,
4695 "should not have conversion after constructor");
4939 // presence of a suitable copy constructor:
4941 // The constructor that would be used to make the copy shall
5127 // -- if T is a class type (clause 9) with a user-declared constructor
5128 // (12.1), then the default constructor for T is called (and the
5130 // constructor);
5132 // -- if T is a class type (clause 9) with either no default constructor
5133 // (12.1 [class.ctor]) or a default constructor that is user-provided
5143 // user-provided or deleted default constructor, then the object is
5144 // zero-initialized and, if T has a non-trivial default constructor,
5147 // constructor' part was removed by DR1507.
5152 // -- if T is a non-union class type without a user-declared constructor,
5159 // occur recursively there, and the implicit default constructor is
5168 // building the constructor call. This affects the semantics of a few
5169 // things (such as whether an explicit default constructor can be called).
5197 // constructor for T is called (and the initialization is ill-formed if
5198 // T has no accessible default constructor);
5209 // default constructor.
5257 if (!Info.Constructor)
5260 if (!Info.Constructor->isInvalidDecl() &&
5261 Info.Constructor->isConvertingConstructor(/*AllowExplicit*/true)) {
5269 S.AddOverloadCandidate(Info.Constructor, Info.FoundDecl,
5348 // - if the function is a constructor, the call initializes a temporary
5356 // - if the function is a constructor, the call is a prvalue of the
5358 // is initialized by the constructor. The call is used to
5380 // In C++17, this does not call a constructor if we enter /17.6.1:
6210 /// constructor.
6296 CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(Best->Function);
6300 S.CheckConstructorAccess(Loc, Constructor, Best->FoundDecl, Entity,
6312 // the selected copy constructor, as if we were going to create a
6313 // proper call to the copy constructor.
6314 for (unsigned I = 1, N = Constructor->getNumParams(); I != N; ++I) {
6315 ParmVarDecl *Parm = Constructor->getParamDecl(I);
6323 S.BuildCXXDefaultArgExpr(Loc, Constructor, Parm);
6330 // constructor call (we might have derived-to-base conversions, or
6331 // the copy constructor may have default arguments).
6332 if (S.CompleteConstructorCall(Constructor, T, CurInitExpr, Loc,
6339 // copy/move constructor and/or destructor for the object have
6349 // of constructor initialization, while copy elision for exception handlers
6361 // Actually perform the constructor call.
6362 CurInit = S.BuildCXXConstructExpr(Loc, T, Best->FoundDecl, Constructor,
6454 /// Returns true if the parameters describe a constructor initialization of
6492 CXXConstructorDecl *Constructor
6496 // Build a call to the selected constructor.
6503 // Force even a trivial, implicit default constructor to be
6506 assert(Constructor->getParent() && "No parent class for constructor.");
6507 if (Constructor->isDefaulted() && Constructor->isDefaultConstructor() &&
6508 Constructor->isTrivial() && !Constructor->isUsed(false)) {
6510 S.DefineImplicitDefaultConstructor(Loc, Constructor);
6519 // of a constructor that takes a reference to possibly cv-qualified
6528 // Determine the arguments required to actually perform the constructor
6530 if (S.CompleteConstructorCall(Constructor, Step.Type, Args, Loc,
6537 if (S.DiagnoseUseOfDecl(Constructor, Loc))
6548 CXXConstructorDecl *CalleeDecl = Constructor;
6551 CalleeDecl = S.findInheritingConstructor(Loc, Constructor, Shadow);
6590 Constructor, /*Elidable=*/true,
6601 Constructor,
6614 S.CheckConstructorAccess(Loc, Constructor, Step.Function.FoundDecl, Entity);
6684 // default member initializer from a constructor that makes the program
6742 // We can reach this case for aggregate initialization in a constructor:
7114 // constructor inherits one as an implicit mem-initializer.
7208 // constructor inherits one as an implicit mem-initializer.
8296 // We have a user-defined conversion that invokes either a constructor
8303 if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Fn)) {
8304 // Build a call to the selected constructor.
8308 // Determine the arguments required to actually perform the constructor
8311 if (S.CompleteConstructorCall(Constructor, Step->Type,
8318 FoundFn, Constructor,
8329 S.CheckConstructorAccess(Kind.getLocation(), Constructor, FoundFn,
8573 // the call to the object's constructor within the next step.
9298 // base within a constructor. If no viable function was
9301 CXXConstructorDecl *Constructor
9304 if (auto Inherited = Constructor->getInheritedConstructor())
9308 << (InheritedFrom ? 2 : Constructor->isImplicit() ? 1 : 0)
9309 << S.Context.getTypeDeclType(Constructor->getParent())
9321 << (InheritedFrom ? 2 : Constructor->isImplicit() ? 1 : 0)
9322 << S.Context.getTypeDeclType(Constructor->getParent())
9382 // a constructor. Complain that it needs to be explicitly
9384 CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(S.CurContext);
9386 << (Constructor->getInheritedConstructor() ? 2 :
9387 Constructor->isImplicit() ? 1 : 0)
9388 << S.Context.getTypeDeclType(Constructor->getParent())
9565 OS << "constructor overloading failed";
9589 OS << "list constructor overloading failed";
9593 OS << "list copy initialization chose explicit constructor";
9696 OS << "constructor initialization";
9700 OS << "list initialization via constructor";
9920 // constructor.
10002 // - For each constructor of the class template designated by the
10065 // When looking for a converting constructor, deduction guides that
10086 // When [...] the constructor [...] is a candidate by
10186 // In copy-list-initialization, if an explicit constructor is chosen, the