Home | History | Annotate | Download | only in Sema

Lines Matching defs:To

52   /// the default argument of a parameter to determine whether it
80 /// VisitDeclRefExpr - Visit a reference to a declaration, to
171 // FIXME: If the call to this decl is using any of its default arguments, we
172 // need to search them for potentially-throwing calls.
183 // change to that specification.
198 "and don't know how to handle them anyway.");
259 // 4) to the parameter type. The default argument expression has
276 // Okay: add the default argument to the parameter
296 /// to the parameter declaration.
358 /// or definition and therefore is not permitted to have default
428 // function declaration, all parameters subsequent to a
432 // declaration (not even to the same value).
437 // definition are added to the set of default arguments provided by the
448 // The declaration context corresponding to the scope is the semantic
486 // for NewParam to find the last source location in the type... but it
488 // is hard to get right:
496 // actually written, which may be a declaration prior to Old.
509 // It's important to use getInit() here; getDefaultArg()
519 // Paragraph 4, quoted above, only applies to non-template functions.
534 // template where the class template specialization to which the
547 // Reading the tea leaves a bit in DR217 and its reference to DR205
548 // leads me to the conclusion that one cannot add default function
637 // We're only interested in pointers and references to functions, as well
638 // as pointers to member functions.
664 /// function declaration are well-formed according to C++
679 // subsequent to a parameter with a default argument shall
682 // by a later declaration (not even to the same value).
703 // default arguments up to (and including) the last missing
739 /// WARNING: Indexes apply to particular diagnostics only!
852 // C++1y allows types to be defined, not just declared.
928 /// \param Diagnosed Set to true if an error is produced.
941 // need to be explicitly initialized. FIXME: Anonymous structs that contain no
1157 // always initialized so do not need to be checked. Dependent bases
1176 // C++1y doesn't require constexpr functions to contain a 'return'
1242 /// the class type currently being defined. If so, update it to the identifier
1299 /// \brief Perform propagation of DLL attributes from a derived class to a
1306 // If the base class template has a DLL attribute, don't try to change it.
1322 // explicit attribute. We should not try to change it.
1334 // different inherited attribute. It's too late for us to change the
1416 // For the MS ABI, propagate DLL attributes to base class templates.
1534 /// specifiers to a C++ class.
1540 // Used to keep track of which base types we have already seen, so
1564 // Delete the duplicate base class specifier; we're going to
1591 // Attach the remaining base class specifiers to the derived class.
1602 /// ActOnBaseSpecifiers - Attach the given base specifiers to the
1628 // If either the base or the derived type is invalid, don't try to
1689 /// CheckDerivedToBaseConversion - Check whether the Derived-to-Base
1694 /// otherwise. Loc is the location where this routine should point to
1695 /// if there is an error, and Range is the source range to highlight
1704 // First, determine whether the path from Derived to Base is
1706 // the Derived to Base conversion exists, because here we need to
1707 // explore multiple paths to determine if there is an ambiguity.
1712 "Can only be used with a derived-to-base conversion");
1736 // We know that the derived-to-base conversion is ambiguous, and
1737 // we're going to produce a diagnostic. Perform the derived-to-base
1738 // search just one more time to compute all of the possible paths so
1740 // the previous derived-to-base checks we've done, but at this point
1745 assert(StillOkay && "Can only be used with a derived-to-base conversion");
1749 // D -> B -> A, that will be used to illustrate the ambiguous
1751 // to each base class subobject.
1775 /// specific derived class to different subobjects of the same base
1779 /// to show the different paths that one can take through the
1780 /// inheritance hierarchy to go from the derived class to different
1792 // We haven't displayed a path to this particular base
1860 // FIXME: We might want to attempt typo correction here.
1892 /// function overrides a virtual member function marked 'final', according to
1939 // For anonymous bitfields, the location should point to the type.
1994 // C++ 9.2p6: A member shall not be declared to have automatic storage
1996 // C++ 7.1.1p8: The mutable specifier can be applied only to names of class
1997 // data members and cannot be applied to names declared const or static,
1998 // and cannot be applied to reference members.
2050 "This is the only DeclSpec that should fail to be applied");
2203 // List of Decls to generate a warning on. Also remove Decls that become
2206 // If non-null, add a note to the warning pointing back to the constructor.
2356 // In class initializers will point to the constructor.
2363 // Diagnose value-uses of fields to initialize themselves, e.g.
2365 // where foo is not also a parameter to the constructor.
2410 // Create a synthetic function scope to represent the call to the constructor
2469 /// correspond to the given base type, for use in base initialization
2488 // FIXME: We might be able to short-circuit this if we know in advance that
2548 // Callback to only accept typo corrections that can be a valid C++ member
2605 // of a single identifier refers to the class member. A
2651 // When the scope specifier can refer to a member of an unknown
2664 // If no results were found, try to correct typos.
2672 // name to what was typed; complain and initialize that
2685 // similar name to what was typed; complain and initialize
2727 /// pointer) members are bound to by-value parameters (or their addresses).
2755 // We only warn when referring to a non-reference parameter declaration.
2896 // and this approach is far more likely to get the corner cases right.
2959 // one of those types will resolve to the same type as
2961 // class initialization. FIXME: Should we try to check the
3025 // and this approach is far more likely to get the corner cases right.
3122 // Cast to the base class to avoid ambiguities.
3199 // Build a reference to this field within the parameter.
3226 // each dimension of the array. We use these index variables to subscript
3251 // Create a reference to the iteration variable.
3255 "Reference to invented variable cannot fail!");
3288 // Direct-initialize to use the copy constructor.
3381 // Default-initialize Objective-C pointers to NULL.
3390 // Nothing to initialize.
3522 // We also apply the same rules to handle anonymous structs within anonymous
3548 // Don't try to build an implicit initializer if there were semantic
3608 // We need to build the initializer AST according to order of construction
3655 // FIXME: Provide a fixit to remove the base specifier. This requires
3839 // Scan forward to try to find this initializer in the idealized
3863 // Move back to the initializer's location in the ideal list.
4019 // user might reasonably want to know why the destructor is being
4203 // going to emit them once, so try to attach them to a diagnostic we're
4204 // actually going to show.
4367 // No need to do the check on definitions, which require that
4424 // seem to be true in practice?
4441 // don't attempt to import them if we have a definition.
4589 // function that is not a constructor declares that member function to be
4607 // If a template instantiates to a non-literal type, but its members
4608 // instantiate to constexpr functions, the template is technically
4625 // ms_struct is a request to use the same ABI rules as MSVC. Check
4628 // That diagnostic defaults to an error, but we allow projects to
4629 // map it down to a warning (or ignore it). It's a fairly common
4630 // practice among users of the ms_struct pragma to mass-annotate
4642 // - The lazy declaration of the other implicit constructors is so as to not
4643 // waste space and performance on classes that are not meant to be
4644 // instantiated (e.g. meta-functions). This doesn't apply to classes that
4658 /// on its RHS, that is, if the argument to the outer special member
4681 /// Is the special member function which would be selected to perform the
4712 // This is important for performance; we need to know whether the default
4713 // constructor is constexpr to determine whether the type is a literal type.
4718 // For copy or move constructors, we need to
4725 // In C++1y, we need to perform overload resolution.
4755 // -- the assignment operator selected to copy/move each direct base
4771 // thereof), the assignment operator selected to copy/move that member is
4821 // Set the calling convention to the default for C++ instance methods.
4840 // Update the type of the special member to use it.
4844 // happens, be sure to update the exception specification on both
4920 // Argument must be reference to possibly-const T.
4954 // Do not apply this rule to members of class templates, since core issue 1358
4955 // makes such functions always instantiate to constexpr functions. For
4975 // If the exception specification needs to be instantiated, do so now,
4988 // -- it is implicitly considered to be constexpr if the implicit
4992 // -- it is implicitly considered to have the same exception-specification
5159 /// Check whether we should delete a special member due to the implicit
5160 /// definition containing a call to a special member of a subobject.
5210 /// Check whether we should delete a special member function due to having a
5221 // to M's default constructor results in an ambiguity or in a function
5225 // overload resolution, as applied to B's corresponding special member,
5251 /// Check whether we should delete a special member function due to the class
5258 /// Check whether we should delete a special member function due to the class
5476 // classes, since we are not going to construct them.
5501 /// member that was most likely to be intended to be trivial, if any.
5524 // to that as an example of why there's not a trivial one.
5559 // - the constructor selected to copy each direct [subobject] is trivial
5563 // ambiguity; no need to actually perform overload resolution.
5568 // In C++98, we are not supposed to perform overload resolution here, but we
5569 // treat that as a language defect, as suggested on cxx-abi-dev, to treat
5578 // - the assignment operator selected to copy each direct [subobject] is
5586 // In C++98, we are not supposed to perform overload resolution here, but we
5596 // The standard doesn't describe how to behave if the lookup is ambiguous.
5610 // not supposed to!
5695 /// Check whether the members of a class type allow a special member to be
5768 // equivalent to the parameter-type-list of an implicit declaration [...]
5827 // -- the [member] selected to copy/move each direct base class subobject
5843 // thereof), the constructor selected to copy/move that member is
5920 /// to be used with CXXRecordDecl::lookupInBases().
5960 /// \brief Add the most overriden methods from MD to Methods
5978 CXXBasePaths Paths(/*FindAmbiguities=*/true, // true to look in all bases.
6060 /// constructor, or destructor, to the given C++ class (C++
6088 // virtual, so we have to declare it immediately. This ensures that, e.g.,
6109 // have to declare the destructor immediately. This ensures that, e.g., it
6123 // get added to the same scope.
6155 // Ignore explicit specializations; they don't contribute to the template
6181 /// This is used to implement the constant expression evaluation part of the
6216 // to make way for the parsed default argument.
6251 /// CheckConstructorDeclarator - Called by ActOnDeclarator to check
6254 /// emit diagnostics and set the invalid bit to true. In any case, the type
6255 /// will be updated to reflect a well-formed type for the constructor and
6359 // to fix the type.
6398 /// CheckDestructorDeclarator - Called by ActOnDeclarator to check
6401 /// emit diagnostics and set the declarator to invalid. Even if this happens,
6402 /// will be updated to reflect a well-formed type for the destructor and
6422 // A destructor is used to destroy objects of its class type. A
6515 /// CheckConversionDeclarator - Called by ActOnDeclarator to check the
6519 /// false. Either way, the type @p R will be updated to reflect a
6604 /// ActOnConversionDeclarator - Called by ActOnDeclarator to complete
6609 assert(Conversion && "Expected to receive a conversion function declaration");
6617 // [...] A conversion function is never used to convert a
6618 // (possibly cv-qualified) object to the (possibly cv-qualified)
6619 // same object type (or a reference to it), to a (possibly
6620 // cv-qualified) base class of that type (or a reference to it),
6621 // or to (possibly cv-qualified) void.
6667 // We support this just well enough to get that case working; this is not
6668 // sufficient to support reopening namespaces as inline in general.
6752 // Continue on to push Namespc as current DeclContext and return it.
6756 // our cache of the "std" namespace to point at this definition.
6843 // redefinition), push it as current DeclContext and try to continue parsing.
6844 // FIXME: We should be able to push Namespc here, so that the each DeclContext
6852 /// is a namespace alias, returns the namespace it points to.
6880 /// \brief Retrieve the special "std" namespace, which may require us to
7009 // is of type std::initializer_list<E> or reference to possibly cv-qualified
7038 // Callback to only accept typo corrections that are namespaces.
7170 // only to the end of the scope.
7262 /// Determines whether to create a using shadow decl for a particular
7263 /// decl, given the set of decls existing prior to this using lookup.
7269 // function will silently decide not to build a shadow decl, which
7272 // We don't need to do this in C++0x because we do the check once on
7281 // resolves to the using decl in B, which is not a base class of D<T>.
7284 // to A::foo, which will look well-formed when we instantiate.
7285 // The right solution is to not collapse the shadow-decl chain.
7320 // If the target happens to be one of the previous declarations, we
7355 // If we're in a record, we want to hide the target, so we
7356 // return true (without a diagnostic) to tell the caller not to
7392 /// Builds a shadow declaration corresponding to a 'using' declaration.
7398 // If we resolved to another shadow declaration, just coalesce them.
7443 /// There are two ways to implement this:
7448 /// The problem with (1) is that we might have to retroactively remove
7470 // be possible for this to happen, because...?
7512 // No-one ever wants a using-declaration to name an injected-class-name
7520 // type; we don't want to suggest 'using Derived::Base;', since that
7592 // It is really dumb that we have to do this.
7599 // and this declaration is being added to a non-block scope, ignore it.
7656 // The normal rules do not apply to inheriting constructor declarations.
7667 // Unlike most lookups, we don't always want to hide tag
7675 // equal to that of the current context.
7683 // Try to correct typos if possible.
7699 // If we corrected to an inheriting constructor, handle it as one.
7702 // Fix up the information we'll use to build the using declaration.
7771 /// Additional checks for a using declaration referring to a constructor name.
7842 // template instantiation can cause this check to trigger when it
7858 /// in the current context is appropriately related to the current
7871 // If we weren't able to compute a valid scope, it must be a
7881 // If we have a complete, non-dependent source type, try to suggest a
7882 // way to get the same effect.
7886 // Find what this using-declaration was referring to.
7894 // Convert 'using X::Y;' to 'using Y = X::Y;'.
7901 // Convert 'using X::Y;' to 'typedef X::Y Y;'.
7911 // Don't provide a fixit outside C++11 mode; we don't want to suggest
7915 // Convert 'using X::Y;' to 'auto &Y = X::Y;'.
7927 // Otherwise, everything is known to be fine.
7936 // nested-name-specifier does not refer to a base class, which is
7939 // Otherwise we have to conservatively report that things might be
7985 // to a member of a base class of the class being defined [etc.].
7987 // Salient point: SS doesn't have to name a base class as long as
7994 // need to be repeated.
8048 // Skip up to the relevant declaration scope.
8206 // We already have an alias with the same name that points to the same
8208 // FIXME: At some point, we'll want to create the (redundant)
8209 // declaration to maintain better source information.
8295 // unable to compute an exception specification for an enclosed class.
8297 // We do not allow an in-class initializer to require the evaluation
8308 // might just be ill-formed because this function attempts to refer to
8331 // FIXME: Copying or moving the parameters could add extra exceptions to the
8384 /// RAII object to register a special member as being currently declared.
8398 // FIXME: Register a note to be produced if we encounter an error while
8406 /// \brief Are we already trying to declare this special member?
8451 // We don't need to use SpecialMemberIsTrivial here; triviality for default
8452 // constructors is easy to compute.
8509 /// Information on inheriting constructors to declare.
8717 // both places is guaranteed to be 0.
8719 // transform the function type to refer to them.
8908 // We don't need to use SpecialMemberIsTrivial here; triviality for
8909 // destructors is easy to compute.
8964 /// \brief Perform any semantic analysis which needs to be delayed until all
8984 // specification is implicitly considered to have the same exception-
9003 // needs to be done somewhere else.
9143 // Compute the size of the memory buffer to be copied.
9148 // Take the address of the field references for "from" and "to". We
9150 // does not permit us to take the address of an xvalue.
9155 Expr *To = ToB.build(S, Loc);
9156 To = new (S.Context) UnaryOperator(To, UO_AddrOf,
9157 S.Context.getPointerType(To->getType()),
9164 // Create a reference to the __builtin_objc_memmove_collectable function
9183 To, From, IntegerLiteral::Create(S.Context, Size, SizeType, Loc)
9188 assert(!Call.isInvalid() && "Call to __builtin_memcpy cannot fail!");
9192 /// \brief Builds a statement that copies/moves the given entity from \p From to
9193 /// \c To.
9195 /// This routine is used to copy/move the members of a class with an
9197 /// copied are arrays, this routine builds for loops to copy them.
9206 /// \param To The expression we are copying/moving to.
9221 const ExprBuilder &To, const ExprBuilder &From,
9225 // Each subobject is assigned in the manner appropriate to its type:
9227 // - if the subobject is of class type, as if by a call to operator= with
9247 // Prior to C++11, filter out any result that isn't a copy/move-assignment
9265 // we're assigning via a base classes's copy-assignment operator. To
9267 // ambiguities), we need to cast "this" to that subobject type; to
9269 // to qualify the operator= name with the base class (see below). However,
9272 // rewrite "protected" access to "public" access in this case, since we
9282 // Create the nested-name-specifier that will be used to qualify the
9283 // reference to operator=; this is required to suppress the virtual
9292 // Create the reference to operator=.
9294 = S.BuildMemberReferenceExpr(To.build(S, Loc), T, Loc, /*isArrow=*/false,
9303 // Build the call to the assignment operator.
9312 // If we built a call to a trivial 'operator=' while copying an array,
9318 // Convert to an expression-statement, and clean up any produced
9328 Loc, BO_Assign, To.build(S, Loc), From.build(S, Loc));
9335 // manner appropriate to the element type;
9357 // Initialize the iteration variable to zero.
9361 // Creates a reference to the iteration variable.
9368 // Subscript the "from" and "to" expressions with the iteration variable.
9377 SubscriptBuilder ToIndex(To, IterationVarRefRVal);
9411 const ExprBuilder &To, const ExprBuilder &From,
9416 return buildMemcpyForAssignmentOp(S, Loc, T, To, From);
9418 StmtResult Result(buildSingleCopyAssignRecursively(S, Loc, T, To, From,
9425 return buildMemcpyForAssignmentOp(S, Loc, T, To, From);
9448 // attempts to deduplicate calls to assignment operators of virtual bases are
9451 // the side of assuming such calls to be made regardless of whether they
9487 // Note: The following rules are largely analoguous to the copy
9526 // Add the parameter to the operator.
9678 // Construct the "from" expression, which is an implicit cast to the
9685 CastBuilder To(DerefThis,
9692 To, From,
9750 // Build references to the field in the object we're copying from and to.
9759 MemberBuilder To(This, getCurrentThisType(), /*IsArrow=*/true, MemberLookup);
9763 To, From,
9827 // attempts to deduplicate calls to assignment operators of virtual bases are
9830 // the side of assuming such calls to be made regardless of whether they
9874 // Note: The following rules are largely analoguous to the move
9903 // Add the parameter to the operator.
9941 // Only a non-trivial move assignment can observe this. We only want to
9967 // If we're not actually going to call a move assignment for this base,
9979 // We're going to move-assign this virtual base, and its move
10009 // We're going to move the base classes of Base. Add them to the list.
10065 // Builds a reference to the "other" object.
10067 // Cast to rvalue.
10080 // FIXME: Do not assign to a vbase that will be assigned by some other base
10095 // Construct the "from" expression, which is an implicit cast to the
10102 // Implicitly cast "this" to the appropriately-qualified base type.
10103 CastBuilder To(DerefThis,
10110 To, From,
10168 // Build references to the field in the object we're copying from and to.
10175 MemberBuilder To(This, getCurrentThisType(),
10184 To, From,
10325 // Add the parameter to the constructor.
10441 // might just be ill-formed because this function attempts to refer to
10488 // Add the parameter to the constructor.
10560 // If we are defining a specialization of a conversion to function-ptr
10562 // so that we can use them to retrieve the corresponding call-operator
10580 // Mark the call operator referenced (and add to pending instantiations
10583 // we construct their body's in this function, so no need to add them
10584 // to the PendingInstantiations.
10609 assert(FunctionRef && "Can't refer to __invoke function?");
10643 // Copy-initialize the lambda object as needed to capture it.
10718 // When certain criteria are met, an implementation is allowed to
10722 // - when a temporary class object that has not been bound to a
10723 // reference (12.2) would be copied/moved to a class object
10739 /// BuildCXXConstructExpr - Creates a complete call to a constructor,
10788 /// to form a proper call to this constructor.
10967 // found in the rest of this subclause do not apply to them unless
10978 // parameter whose type is a class, a reference to a class, an
10979 // enumeration, or a reference to an enumeration.
11171 // Otherwise it must be a pointer to const; let's strip those qualifiers.
11180 // Move on to the second parameter;
11191 // are allowed as the first parameter to a two-parameter function
11214 // equivalent to any of the permitted forms.
11294 // Attribute declarations appertain to empty declaration so we handle
11321 // The exception-declaration shall not denote a pointer or reference to an
11389 // We just pretend to initialize the object with itself, then make sure
11503 // constant expression that can be contextually converted to bool.
11555 // If we evaluated the type to a record type, suggest putting
11734 /// in a friend declaration is required to obey the restrictions of a
11736 /// parameters are required to match up with simple template-ids, &c.
11738 /// okay to refer to a template specialization without an empty
11751 // Try to convert the decl specifier to a type. This works for
11763 // This is definitely an error in C++98. It's probably meant to
11771 // 'foo' to equal C. There are restrictions on class-heads
11772 // (which we declare (by fiat) elaborated friend declarations to
11787 // affects inner classes and which nobody else seems to implement;
11790 // But note that we could warn about it: it's always useless to
11791 // friend one of your own members (it's not, however, worthless to
11827 // according to [temp.arg.type]p3:
11831 // function declarator to have a function type, the program
11836 // It might be worthwhile to try to recover by creating an
11906 // declared the function in, if we were permitted to, for error recovery.
11919 // - There's no scope specifier, in which case we just go to the
11926 // elaborated-type-specifier, the lookup to determine whether
11931 // Find the appropriate context according to the above.
12038 // This implies that it has to be an operator or function.
12049 // FIXME: This is an egregious hack to cope with cases where the scope stack
12069 // Add the function declaration to the appropriate lookup tables,
12071 // want to do this yet if the friending class is dependent.
12153 // See if we're deleting a function which is already known to override a
12307 /// Both types must be pointers or references to classes.
12322 // The return types aren't either both pointers or references to a class type.
12357 // Check if we the conversion from derived to base is valid.
12365 // diagnostics, and it's impossible to get an undelayed error
12402 /// \param Method the method to be marked pure.
12429 /// ActOnCXXEnterDeclInitializer - Invoked when we are about to parse
12433 /// After this method is called, according to [C++ 3.4.1p13], if 'Dcl' is a
12525 // Try to insert this class into the map.
12531 // If we already had an entry, check to see if we are promoting this vtable
12532 // to required a definition. If so, we need to reappend to the VTableUses
12556 // Local classes need to have their virtual members marked
12572 // time through the loop and prefer indices (which are stable) to
12585 // defined in another translation unit, we don't need to emit the
12622 // We may choose to emit it available_externally anyway.
12791 // Don't add a note for a function delegating directly to itself.
12831 /// \brief AST visitor that finds references to the 'this' expression.
13093 // Check to see if this name was declared as a member previously