Home | History | Annotate | Download | only in Sema

Lines Matching defs:This

5 // This file is distributed under the University of Illinois Open Source
10 // This file implements semantic analysis for C++ declarations.
50 /// contains any ill-formed subexpressions. For example, this will
68 /// VisitExpr - Visit all of the children of this expression.
77 /// determine whether this declaration can be used in the default
106 /// VisitCXXThisExpr - Visit a C++ "this" expression.
109 // The keyword this shall not be used in a default argument of a
142 // If this function can throw any exceptions, make a note of that.
149 // FIXME: If the call to this decl is using any of its default arguments, we
152 // If this function has a basic noexcept, it doesn't affect the outcome.
156 // If we have a throw-all spec at this point, ignore the function.
191 // Record the exceptions in this function's exception specification.
247 InitializationSequence InitSeq(*this, Entity, Kind, &Arg, 1);
248 ExprResult Result = InitSeq.Perform(*this, Entity, Kind,
249 MultiExprArg(*this, &Arg, 1));
260 // We have already instantiated this parameter; provide each of the
268 // We're done tracking this parameter's instantiations.
302 CheckDefaultArgumentVisitor DefaultArgChecker(DefaultArg, this);
313 /// because we're inside a class definition. Note that this default
344 /// arguments. This routine should be invoked for every declarator
393 // arguments supplied in this or previous declarations. A
441 // isn't worth the effort right now. This is the kind of test case that
551 /// This is called when there's a redeclaration of a VarDecl. The function
610 // FIXME: Core issue 974 strikes this sentence, we only provide an
622 // have default arguments supplied in this or previous
630 /* We already complained about this parameter. */;
683 // This implements C++11 [dcl.constexpr]p3,4, as amended by DR1360.
713 // If it's not obvious why this function is virtual, find an overridden
733 if (!CheckConstexprParameterTypes(*this, NewFD))
807 /// \param Field The field being checked. This may be a member of an anonymous
878 if (!CheckConstexprDeclStmt(*this, Dcl, cast<DeclStmt>(*BodyIt)))
946 CheckConstexprCtorInitializer(*this, Dcl, *I, Inits, Diagnosed);
988 /// nested classes, this will only return true if II is the name of
1163 // Okay, add this new base class.
1220 // FIXME: instantiate DerivedRD if necessary. We need a PoI for this.
1281 /// otherwise. Loc is the location where this routine should point to
1292 // ambiguous. This is slightly more expensive than checking whether
1325 // that we can print them out. This is more expensive than any of
1326 // the previous derived-to-base checks we've done, but at this point
1363 /// This function builds a string that can be used in error messages
1366 /// subobjects of a base class. The result looks something like this:
1377 // We haven't displayed a path to this particular base
1443 /// ActOnCXXMemberDeclarator - This is invoked when a C++ class member
1487 // FIXME: It would be nicer if the keyword was ignored only for this
1519 // So TemplateParameterLists should be empty in this case.
1529 // There is an extraneous 'template<>' for this member.
1633 /// ActOnCXXInClassMemberInitializer - This is invoked after parsing an
1666 InitializationSequence Seq(*this, Entity, Kind, Inits, NumInits);
1667 Init = Seq.Perform(*this
1704 // We found a direct base of this type. That's what we're
1712 // FIXME: We might be able to short-circuit this if we know in advance that
1859 LookupResult R(*this, MemberOrBase, IdLoc, LookupOrdinaryName);
1911 if (FindBaseInitializer(*this, ClassDecl,
1966 // FIXME: Would this be relevant for ObjC object pointers? Or block pointers?
2049 // Exception #1: The field may not belong to this record.
2053 // Even though the field matches, it does not belong to this record.
2072 // An expression such as 'member(arg ?: "")' may trigger this.
2098 // TODO: implement -Wuninitialized and fold this into that framework.
2113 // uninitialized. For example, let this field be the i'th field. When
2150 InitializationSequence InitSeq(*this, MemberEntity, Kind, Args, NumArgs);
2151 ExprResult MemberInit = InitSeq.Perform(*this, MemberEntity, Kind,
2152 MultiExprArg(*this, Args, NumArgs),
2168 // perform this type-checking again. Just save the arguments that we
2170 // FIXME: This isn't quite ideal, since our ASTs don't capture all
2173 // and this approach is far more likely to get the corner cases right.
2178 CheckForDanglingReferenceOrPointer(*this, Member, Init, IdLoc);
2219 InitializationSequence InitSeq(*this, DelegationEntity, Kind, Args, NumArgs);
2220 ExprResult DelegationInit = InitSeq.Perform(*this, DelegationEntity, Kind,
2221 MultiExprArg(*this, Args,NumArgs),
2264 // This is a pack expansion.
2288 FindBaseInitializer(*this, ClassDecl, BaseType, DirectBaseSpec,
2298 // BaseType. Therefore, just treat this as a dependent base
2347 InitializationSequence InitSeq(*this, BaseEntity, Kind, Args, NumArgs);
2348 ExprResult BaseInit = InitSeq.Perform(*this, BaseEntity, Kind,
2349 MultiExprArg(*this, Args, NumArgs),
2364 // perform this type-checking again. Just save the arguments that we
2366 // FIXME: This isn't quite ideal, since our ASTs don't capture all
2369 // and this approach is far more likely to get the corner cases right.
2516 // Build a reference to this field within the parameter.
2553 // Create the iteration variable for this array index.
2577 // Subscript the array with this iteration variable.
2591 // Construct the entity that we will be initializing. For an array, this
2780 // Overwhelmingly common case: we have a direct initializer for this field.
2871 BaseAndFieldInfo Info(*this, Constructor, AnyErrors);
2908 if (BuildImplicitBaseInitializer(*this, Constructor, Info.IIK,
2931 if (BuildImplicitBaseInitializer(*this, Constructor, Info.IIK,
2960 if (CollectFieldInitializer(*this, Info, F))
2965 // Beyond this point, we only consider default initialization.
2977 if (CollectFieldInitializer(*this, Info, F->getAnonField(), F))
3067 // this same order but may be missing things.
3103 // Scan forward to try to find this initializer in the idealized
3109 // If we didn't find this initializer, it must be because we
3229 // For member initializers, this is keyed with a FieldDecl*.
3230 // For base initializers, this is keyed with a Type*.
3245 if (CheckRedundantInit(*this, Init, Members[Field]) ||
3246 CheckRedundantUnionInit(*this, Init, MemberUnions))
3250 if (CheckRedundantInit(*this, Init, Members[Key]))
3254 // This must be the only initializer
3260 // We will treat this as being the only initializer.
3271 DiagnoseBaseOrMemInitializerOrder(*this, Constructor, MemInits, NumMemInits);
3447 // for this class.
3602 CheckAbstractUsage(*this, D).Visit(TL, Sel);
3616 // information. This should never happen for non-implicit methods,
3665 AbstractUsageInfo Info(*this, Record);
3669 // If this is not an aggregate type and has no user-declared constructor,
3747 // suppress this (less useful) diagnostic.
3776 // Declare inherited constructors. We do this eagerly here because:
3781 // instantiated (e.g. meta-functions). This doesn't apply to classes that
3831 // Whether this was the first-declared instance of the constructor.
3832 // This affects whether we implicitly add an exception spec (and, eventually,
3859 // Do not apply this rule to templates, since core issue 1358 makes such
3892 // will be silently overridden. We should issue a warning if this happens.
3919 // Whether this was the first-declared instance of the constructor.
3929 ImplicitExceptionSpecification Spec(*this);
3940 // This is a copy ctor so we know it's a cv-qualified reference to T.
3954 // Do not apply this rule to templates, since core issue 1358 makes such
3987 // will be silently overridden. We should issue a warning if this happens.
4018 // Whether this was the first-declared instance of the operator
4038 ImplicitExceptionSpecification Spec(*this);
4109 // Whether this was the first-declared instance of the constructor.
4128 // This is a move ctor so we know it's a cv-qualified rvalue reference to T.
4142 // Do not apply this rule to templates, since core issue 1358 makes such
4175 // will be silently overridden. We should issue a warning if this happens.
4206 // Whether this was the first-declared instance of the operator
4295 // Whether this was the first-declared instance of the destructor.
4416 /// type of this special member.
4617 // This is technically non-conformant, but sanity demands it.
4632 // This is a silly definition, because it gives an empty union a deleted
4706 ContextRAII MethodContext(*this, MD);
4723 SpecialMemberDeletionInfo SMI(*this, MD, CSM, Diagnose);
4814 Data.S = this;
4817 // by 'using' in a set. A base method not in this set is hidden.
4865 /// [special]p1). This routine can only be executed just before the
4881 // virtual, so we have to declare it immediately. This ensures that, e.g.,
4900 // have to declare the destructor immediately. This ensures that, e.g., it
4967 /// arguments. This action should enter the scope of the given
4978 /// ActOnParamDefaultArgument event for this parameter.
4985 // If this parameter has an unparsed default argument, clear it out
4999 /// immediately!) for this method, if it was also defined inside the
5023 /// R. If there are any errors in the declarator, this routine will
5165 /// R. If there are any errors in the declarator, this routine will
5166 /// emit diagnostics and set the declarator to invalid. Even if this happens,
5272 /// type @p R. If there are any errors in the declarator, this routine
5322 // Diagnose "&operator bool()" and other such nonsense. This
5360 /// the declaration of the given C++ conversion function. This routine
5377 // FIXME: Suppress this warning if the conversion function ends up being a
5412 /// ActOnStartNamespaceDef - This is called at the start of a namespace
5459 // This is an extended namespace definition.
5476 // This is an invalid name redefinition.
5484 // This is the first "real" definition of the namespace "std", so update
5485 // our cache of the "std" namespace to point at this definition.
5490 // We've seen this namespace for the first time.
5551 // replaced by the same identifier and this identifier differs
5592 /// ActOnFinishNamespaceDef - This callback is called after a namespace is
5637 if (!StdNamespace) // If we haven't seen namespace std yet, this can't be it.
5662 // Haven't recognized std::initializer_list yet, maybe this is it.
5669 // This is a template called std::initializer_list, but is it the right
5684 // This is an instance of std::initializer_list. Find the argument type.
5726 StdInitializerList = LookupStdInitializerList(*this, Loc);
5824 // This can only happen along a recovery path.
5835 LookupResult R(*this, NamespcName, IdentLoc, LookupNamespaceName);
5851 else TryNamespaceTypoCorrection(*this, R, S, SS, IdentLoc, NamespcName);
5865 // namespace. [Note: in this context, "contains" means "contains
6003 /// decl, given the set of decls existing prior to this using lookup.
6007 // current class. We do this now because there are cases where this
6011 // We don't need to do this in C++0x because we do the check once on
6019 // This is invalid (during instantiation) in C++03 because B::foo
6099 // If we're not in a record, this is an error.
6160 /// Hides a using shadow declaration. This is required by the current
6178 /// There are two ways to implement this:
6186 /// (2) avoids this but is very fiddly and phase-dependent.
6205 // be possible for this to happen, because...?
6210 /// \param IsInstantiation - Whether this call arises from an
6233 LookupResult Previous(*this, NameInfo, LookupUsingDeclName,
6239 // It is really dumb that we have to do this.
6299 LookupResult R(*this, NameInfo, LookupOrdinaryName);
6308 // For the purposes of this lookup, we have a base object type
6341 // but only if this is an instantiation of an unresolved using
6405 /// redeclaration. Note that this is checking only for the using decl
6448 // template instantiation can cause this check to trigger when it
6502 // Ideally this would point at the last name in the specifier,
6563 return !Class->forallBases(collect, this);
6574 return Bases.count(Class) || !Class->forallBases(doesNotContain, this);
6628 LookupResult Previous(*this, NameInfo, LookupOrdinaryName, ForRedeclaration);
6697 // FIXME: The C++0x standard does not clearly say this is ill-formed,
6747 LookupResult R(*this, Ident, IdentLoc, LookupNamespaceName);
6779 if (!TryNamespaceTypoCorrection(*this, R, S, SS, IdentLoc, Ident)) {
6821 ImplicitExceptionSpecification ExceptSpec(*this);
6835 // If this is a deleted function, add it anyway. This might be conformant
6836 // with the standard. This might not. I'm not sure. It might not matter.
6849 // If this is a deleted function, add it anyway. This
6850 // with the standard. This might not. I'm not sure. It might not matter.
6869 // If this is a deleted function, add it anyway. This might be conformant
6870 // with the standard. This might not. I'm not sure. It might not matter.
6871 // In particular, the problem is that this function never gets called. It
6872 // might just be ill-formed because this function attempts to refer to
6915 // Note that we have declared this constructor.
6938 ImplicitlyDefinedFunctionScope Scope(*this, Constructor);
6989 = getDefaultedDefaultConstructorUnsafe(*this, ClassDecl);
6997 // FIXME: Don't do this unless the exception spec is needed.
7069 // Find the using declaration for inheriting this base's constructors.
7073 LookupResult Result(*this, Name, SourceLocation(), LookupUsingDeclName);
7104 // Build up a function type for this particular constructor.
7107 // source. This code doesn't yet, either. When it does, this code will
7129 // constructor with this signature.
7134 // with this signature.
7198 ImplicitExceptionSpecification ExceptSpec(*this);
7264 // Note that we have declared this destructor.
7267 // Introduce this destructor into its scope.
7272 // This could be uniqued if it ever proves significant.
7295 ImplicitlyDefinedFunctionScope Scope(*this, Destructor);
7346 // spec doesn't allow exceptions, we should emit a warning, because this
7354 /// This routine is used to copy/move the members of a class with an
7356 /// copied are arrays, this routine builds for loops to copy them.
7363 /// must have this type.
7413 // assignment operators we found. This strange dance is required when
7416 // ambiguities), we need to cast "this" to that subobject type; to
7419 // this means that if the base class has a protected copy assignment
7421 // rewrite "protected" access to "public" access in this case, since we
7432 // reference to operator=; this is required to suppress the virtual
7501 // Create a reference to the iteration variable; we'll use this several
7543 // Construct the loop that copies all elements of this array.
7554 return std::make_pair(ImplicitExceptionSpecification(*this), false);
7573 // We'll handle this below
7623 // made. As such, this exception specification is effectively unspecified.
7627 ImplicitExceptionSpecification ExceptSpec(*this);
7673 ImplicitExceptionSpecification Spec(*this);
7710 // Note that we have added this copy-assignment operator.
7747 ImplicitlyDefinedFunctionScope Scope(*this, CopyAssignOperator);
7759 ASTOwningVector<Stmt*> Statements(*this);
7774 // Construct a reference to the "other" object. We'll be using this
7779 // Construct the "this" pointer. We'll be using this throughout the generated
7781 Expr *This = ActOnCXXThis(Loc).takeAs<Expr>();
7782 assert(This && "Reference to this cannot fail!");
7789 // static_cast<Base*>(this)->Base::operator=(static_cast<Base&>(other));
7806 // Dereference "this".
7807 ExprResult To = CreateBuiltinUnaryOp(Loc, UO_Deref, This);
7809 // Implicitly cast "this" to the appropriately-qualified base type.
7817 StmtResult Copy = BuildSingleCopyAssign(*this, Loc, BaseType,
7880 LookupResult MemberLookup(*this, Field->getDeclName(), Loc,
7888 ExprResult To = BuildMemberReferenceExpr(This, This->getType(),
7896 // explicit assignments, do so. This optimization only applies for arrays
7925 LookupResult R(*this,
7946 LookupResult R(*this, &Context.Idents.get("__builtin_memcpy"), Loc,
7964 this);
7985 // Build the copy of this field.
7986 StmtResult Copy = BuildSingleCopyAssign(*this, Loc, FieldType,
8002 // Add a "return *this;"
8003 ExprResult ThisObj = CreateBuiltinUnaryOp(Loc, UO_Deref, This);
8026 CompoundScopeRAII CompoundScope(*this);
8040 ImplicitExceptionSpecification ExceptSpec(*this);
8051 // made. As such, this exception specification is effectively unspecified.
8198 if (hasVirtualBaseWithNonTrivialMoveAssignment(*this, ClassDecl) ||
8199 !subobjectsHaveMoveOrTrivialCopy(*this, ClassDecl,/*Constructor*/false)) {
8241 // Note that we have added this copy-assignment operator.
8252 // Cache this result so that we don't try to generate this over and over
8284 ImplicitlyDefinedFunctionScope Scope(*this, MoveAssignOperator);
8296 ASTOwningVector<Stmt*> Statements(*this);
8308 // Construct a reference to the "other" object. We'll be using this
8313 OtherRef = CastForMoving(*this, OtherRef);
8315 // Construct the "this" pointer. We'll be using this throughout the generated
8317 Expr *This = ActOnCXXThis(Loc).takeAs<Expr>();
8318 assert(This && "Reference to this cannot fail!");
8325 // static_cast<Base*>(this)->Base::operator=(static_cast<Base&&>(other));
8341 // Dereference "this".
8342 ExprResult To = CreateBuiltinUnaryOp(Loc, UO_Deref, This);
8344 // Implicitly cast "this" to the appropriately-qualified base type.
8352 StmtResult Move = BuildSingleCopyAssign(*this, Loc, BaseType,
8415 LookupResult MemberLookup(*this, Field->getDeclName(), Loc,
8423 ExprResult To = BuildMemberReferenceExpr(This, This->getType(),
8435 // explicit assignments, do so. This optimization only applies for arrays
8470 LookupResult R(*this,
8491 LookupResult R(*this, &Context.Idents.get("__builtin_memcpy"), Loc,
8509 ASTOwningVector<Expr*> CallArgs(*this);
8530 // Build the move of this field.
8531 StmtResult Move = BuildSingleCopyAssign(*this, Loc, FieldType,
8547 // Add a "return *this;"
8548 ExprResult ThisObj = CreateBuiltinUnaryOp(Loc, UO_Deref, This);
8571 CompoundScopeRAII CompoundScope(*this);
8586 return std::make_pair(ImplicitExceptionSpecification(*this), false);
8595 // FIXME: It ought to be possible to store this on the record.
8647 ImplicitExceptionSpecification ExceptSpec(*this);
8694 ImplicitExceptionSpecification Spec(*this);
8725 // Note that we have declared this constructor.
8763 ImplicitlyDefinedFunctionScope Scope(*this, CopyConstructor);
8772 Sema::CompoundScopeRAII CompoundScope(*this);
8775 MultiStmtArg(*this, 0, 0),
8792 ImplicitExceptionSpecification ExceptSpec(*this);
8806 // If this is a deleted function, add it anyway. This might be conformant
8807 // with the standard. This might not. I'm not sure. It might not matter.
8820 // If this is a deleted function, add it anyway. This might be conformant
8821 // with the standard. This might not. I'm not sure. It might not matter.
8835 // If this is a deleted function, add it anyway. This might be conformant
8836 // with the standard. This might not. I'm not sure. It might not matter.
8837 // In particular, the problem is that this function never gets called. It
8838 // might just be ill-formed because this function attempts to refer to
8864 if (!subobjectsHaveMoveOrTrivialCopy(*this, ClassDecl, /*Constructor*/true)) {
8911 // Cache this result so that we don't try to generate this over and over
8917 // Note that we have declared this constructor.
8938 ImplicitlyDefinedFunctionScope Scope(*this, MoveConstructor);
8947 Sema::CompoundScopeRAII CompoundScope(*this);
8950 MultiStmtArg(*this, 0, 0),
8986 markLambdaCallOperatorUsed(*this, Lambda);
8990 ImplicitlyDefinedFunctionScope Scope(*this, Conv);
9024 ImplicitlyDefinedFunctionScope Scope(*this, Conv);
9028 Expr *This = ActOnCXXThis(CurrentLocation).take();
9029 Expr *DerefThis =CreateBuiltinUnaryOp(CurrentLocation, UO_Deref, This).take();
9036 // behavior. Note that only the general conversion function does this
9193 // TODO: this should be re-enabled for static locals by !CXAAtExit
9200 /// to form a proper call to this constructor.
9209 // FIXME: This duplicates a lot of code from Sema::ConvertArgumentsForCall.
9360 /// of this overloaded operator is well-formed. If so, returns false;
9372 // found in the rest of this subclause do not apply to them unless
9375 return CheckOperatorDeleteDeclaration(*this, FnDecl);
9378 return CheckOperatorNewDeclaration(*this, FnDecl);
9438 // described in the rest of this subclause.
9477 // prefix and postfix ++ operator. If this function is a member
9501 /// of this literal operator function is well-formed. If so, returns
9517 // This might be the definition of a literal operator template.
9519 // This might be a specialization of a literal operator template.
9592 // FIXME: This diagnostic is absolutely terrible.
9630 /// the '{' brace. Otherwise, this linkage specification does not
9765 InitializationSequence sequence(*this, entity, initKind, &opaqueValue, 1);
9766 ExprResult result = sequence.Perform(*this, entity, initKind,
9771 // If the constructor used was non-trivial, set this as the
9832 // Add the exception declaration into this scope.
9965 // This is a declaration of a class template.
10063 /// Handle a friend type declaration. This works in tandem with
10077 /// We permit this as a special case; if there are any template
10087 // Try to convert the decl specifier to a type. This works for
10099 // This is definitely an error in C++98. It's probably meant to
10109 // be) that makes this tractable.
10121 // This is fixed in DR77, which just barely didn't make the C++03
10161 // Note that this sees through typedefs, which is intended.
10165 // type dependent on a template-parameter and this causes
10207 LookupResult Previous(*this, NameInfo, LookupOrdinaryName,
10238 // for this behavior, that would be nice --- it's what GCC and
10263 // C++11 changes this for both friend types and functions.
10294 // TODO: better diagnostics for this case. Suggesting the right
10354 // This implies that it has to be an operator or function.
10365 // FIXME: This is an egregious hack to cope with cases where the scope stack
10384 // want to do this yet if the friending class is dependent.
10483 // If this definition appears within the record, do the checking when
10565 SearchForReturnInStmt(*this, Handler);
10632 // FIXME: Should this point to the return type?
10634 // FIXME: this note won't trigger for delayed access control
10696 /// is a fresh scope pushed for just this purpose.
10698 /// After this method is called, according to [C++ 3.4.1p13], if 'Dcl' is a
10711 // new expression evaluation context that is associated with this static
10787 // Try to insert this class into the map.
10793 // If we already had an entry, check to see if we are promoting this vtable
10830 // If this class has a key function, but that key function is
10872 // Mark all of the virtual members of this class as referenced, so
10874 // vtable for this class is required.
10924 /// SetIvarInitializers - This routine builds initialization ASTs for the
10945 InitializationSequence InitSeq(*this, InitEntity, InitKind, 0, 0);
10947 InitSeq.Perform(*this, InitEntity, InitKind, MultiExprArg());
11015 // If we haven't diagnosed this cycle yet, do so now.
11055 DelegatingCycleHelper(*I, Valid, Invalid, Current, *this);
11063 /// \brief AST visitor that finds references to the 'this' expression.
11089 // [The expression this] shall not appear before the optional
11093 // function). [ Note: this is because declaration matching does not occur
11096 FindCXXThisExpr Finder(*this);
11121 FindCXXThisExpr Finder(*this);
11150 FindCXXThisExpr Finder(*this);
11155 // FIXME: This should be emitted by tblgen.
11280 // Dig out the prototype. This should never fail.
11321 /// IdentifyCUDATarget - Determine the CUDA compilation target for this function