clang  6.0.0svn
Overload.h
Go to the documentation of this file.
1 //===--- Overload.h - C++ Overloading ---------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the data structures and types used in C++
11 // overload resolution.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_SEMA_OVERLOAD_H
16 #define LLVM_CLANG_SEMA_OVERLOAD_H
17 
18 #include "clang/AST/Decl.h"
19 #include "clang/AST/DeclTemplate.h"
20 #include "clang/AST/Expr.h"
21 #include "clang/AST/TemplateBase.h"
22 #include "clang/AST/Type.h"
26 #include "llvm/ADT/SmallPtrSet.h"
27 #include "llvm/ADT/SmallVector.h"
28 #include "llvm/Support/AlignOf.h"
29 #include "llvm/Support/Allocator.h"
30 
31 namespace clang {
32  class ASTContext;
33  class CXXConstructorDecl;
34  class CXXConversionDecl;
35  class FunctionDecl;
36  class Sema;
37 
38  /// OverloadingResult - Capture the result of performing overload
39  /// resolution.
41  OR_Success, ///< Overload resolution succeeded.
42  OR_No_Viable_Function, ///< No viable function found.
43  OR_Ambiguous, ///< Ambiguous candidates found.
44  OR_Deleted ///< Succeeded, but refers to a deleted function.
45  };
46 
48  /// Requests that all candidates be shown. Viable candidates will
49  /// be printed first.
51 
52  /// Requests that only viable candidates be shown.
54  };
55 
56  /// ImplicitConversionKind - The kind of implicit conversion used to
57  /// convert an argument to a parameter's type. The enumerator values
58  /// match with Table 9 of (C++ 13.3.3.1.1) and are listed such that
59  /// better conversion kinds have smaller values.
61  ICK_Identity = 0, ///< Identity conversion (no conversion)
62  ICK_Lvalue_To_Rvalue, ///< Lvalue-to-rvalue conversion (C++ 4.1)
63  ICK_Array_To_Pointer, ///< Array-to-pointer conversion (C++ 4.2)
64  ICK_Function_To_Pointer, ///< Function-to-pointer (C++ 4.3)
65  ICK_Function_Conversion, ///< Function pointer conversion (C++17 4.13)
66  ICK_Qualification, ///< Qualification conversions (C++ 4.4)
67  ICK_Integral_Promotion, ///< Integral promotions (C++ 4.5)
68  ICK_Floating_Promotion, ///< Floating point promotions (C++ 4.6)
69  ICK_Complex_Promotion, ///< Complex promotions (Clang extension)
70  ICK_Integral_Conversion, ///< Integral conversions (C++ 4.7)
71  ICK_Floating_Conversion, ///< Floating point conversions (C++ 4.8)
72  ICK_Complex_Conversion, ///< Complex conversions (C99 6.3.1.6)
73  ICK_Floating_Integral, ///< Floating-integral conversions (C++ 4.9)
74  ICK_Pointer_Conversion, ///< Pointer conversions (C++ 4.10)
75  ICK_Pointer_Member, ///< Pointer-to-member conversions (C++ 4.11)
76  ICK_Boolean_Conversion, ///< Boolean conversions (C++ 4.12)
77  ICK_Compatible_Conversion, ///< Conversions between compatible types in C99
78  ICK_Derived_To_Base, ///< Derived-to-base (C++ [over.best.ics])
79  ICK_Vector_Conversion, ///< Vector conversions
80  ICK_Vector_Splat, ///< A vector splat from an arithmetic type
81  ICK_Complex_Real, ///< Complex-real conversions (C99 6.3.1.7)
82  ICK_Block_Pointer_Conversion, ///< Block Pointer conversions
83  ICK_TransparentUnionConversion, ///< Transparent Union Conversions
84  ICK_Writeback_Conversion, ///< Objective-C ARC writeback conversion
85  ICK_Zero_Event_Conversion, ///< Zero constant to event (OpenCL1.2 6.12.10)
86  ICK_Zero_Queue_Conversion, ///< Zero constant to queue
87  ICK_C_Only_Conversion, ///< Conversions allowed in C, but not C++
88  ICK_Incompatible_Pointer_Conversion, ///< C-only conversion between pointers
89  /// with incompatible types
90  ICK_Num_Conversion_Kinds, ///< The number of conversion kinds
91  };
92 
93  /// ImplicitConversionRank - The rank of an implicit conversion
94  /// kind. The enumerator values match with Table 9 of (C++
95  /// 13.3.3.1.1) and are listed such that better conversion ranks
96  /// have smaller values.
98  ICR_Exact_Match = 0, ///< Exact Match
99  ICR_Promotion, ///< Promotion
100  ICR_Conversion, ///< Conversion
101  ICR_OCL_Scalar_Widening, ///< OpenCL Scalar Widening
102  ICR_Complex_Real_Conversion, ///< Complex <-> Real conversion
103  ICR_Writeback_Conversion, ///< ObjC ARC writeback conversion
104  ICR_C_Conversion, ///< Conversion only allowed in the C standard.
105  /// (e.g. void* to char*)
106  ICR_C_Conversion_Extension ///< Conversion not allowed by the C standard,
107  /// but that we accept as an extension anyway.
108  };
109 
111 
112  /// NarrowingKind - The kind of narrowing conversion being performed by a
113  /// standard conversion sequence according to C++11 [dcl.init.list]p7.
115  /// Not a narrowing conversion.
117 
118  /// A narrowing conversion by virtue of the source and destination types.
120 
121  /// A narrowing conversion, because a constant expression got narrowed.
123 
124  /// A narrowing conversion, because a non-constant-expression variable might
125  /// have got narrowed.
127 
128  /// Cannot tell whether this is a narrowing conversion because the
129  /// expression is value-dependent.
131  };
132 
133  /// StandardConversionSequence - represents a standard conversion
134  /// sequence (C++ 13.3.3.1.1). A standard conversion sequence
135  /// contains between zero and three conversions. If a particular
136  /// conversion is not needed, it will be set to the identity conversion
137  /// (ICK_Identity). Note that the three conversions are
138  /// specified as separate members (rather than in an array) so that
139  /// we can keep the size of a standard conversion sequence to a
140  /// single word.
142  public:
143  /// First -- The first conversion can be an lvalue-to-rvalue
144  /// conversion, array-to-pointer conversion, or
145  /// function-to-pointer conversion.
147 
148  /// Second - The second conversion can be an integral promotion,
149  /// floating point promotion, integral conversion, floating point
150  /// conversion, floating-integral conversion, pointer conversion,
151  /// pointer-to-member conversion, or boolean conversion.
153 
154  /// Third - The third conversion can be a qualification conversion
155  /// or a function conversion.
157 
158  /// \brief Whether this is the deprecated conversion of a
159  /// string literal to a pointer to non-const character data
160  /// (C++ 4.2p2).
162 
163  /// \brief Whether the qualification conversion involves a change in the
164  /// Objective-C lifetime (for automatic reference counting).
166 
167  /// IncompatibleObjC - Whether this is an Objective-C conversion
168  /// that we should warn about (if we actually use it).
169  unsigned IncompatibleObjC : 1;
170 
171  /// ReferenceBinding - True when this is a reference binding
172  /// (C++ [over.ics.ref]).
173  unsigned ReferenceBinding : 1;
174 
175  /// DirectBinding - True when this is a reference binding that is a
176  /// direct binding (C++ [dcl.init.ref]).
177  unsigned DirectBinding : 1;
178 
179  /// \brief Whether this is an lvalue reference binding (otherwise, it's
180  /// an rvalue reference binding).
181  unsigned IsLvalueReference : 1;
182 
183  /// \brief Whether we're binding to a function lvalue.
184  unsigned BindsToFunctionLvalue : 1;
185 
186  /// \brief Whether we're binding to an rvalue.
187  unsigned BindsToRvalue : 1;
188 
189  /// \brief Whether this binds an implicit object argument to a
190  /// non-static member function without a ref-qualifier.
192 
193  /// \brief Whether this binds a reference to an object with a different
194  /// Objective-C lifetime qualifier.
196 
197  /// FromType - The type that this conversion is converting
198  /// from. This is an opaque pointer that can be translated into a
199  /// QualType.
200  void *FromTypePtr;
201 
202  /// ToType - The types that this conversion is converting to in
203  /// each step. This is an opaque pointer that can be translated
204  /// into a QualType.
205  void *ToTypePtrs[3];
206 
207  /// CopyConstructor - The copy constructor that is used to perform
208  /// this conversion, when the conversion is actually just the
209  /// initialization of an object via copy constructor. Such
210  /// conversions are either identity conversions or derived-to-base
211  /// conversions.
214 
215  void setFromType(QualType T) { FromTypePtr = T.getAsOpaquePtr(); }
216  void setToType(unsigned Idx, QualType T) {
217  assert(Idx < 3 && "To type index is out of range");
218  ToTypePtrs[Idx] = T.getAsOpaquePtr();
219  }
221  ToTypePtrs[0] = T.getAsOpaquePtr();
222  ToTypePtrs[1] = ToTypePtrs[0];
223  ToTypePtrs[2] = ToTypePtrs[0];
224  }
225 
227  return QualType::getFromOpaquePtr(FromTypePtr);
228  }
229  QualType getToType(unsigned Idx) const {
230  assert(Idx < 3 && "To type index is out of range");
231  return QualType::getFromOpaquePtr(ToTypePtrs[Idx]);
232  }
233 
235 
236  bool isIdentityConversion() const {
237  return Second == ICK_Identity && Third == ICK_Identity;
238  }
239 
241  NarrowingKind getNarrowingKind(ASTContext &Context, const Expr *Converted,
242  APValue &ConstantValue,
243  QualType &ConstantType) const;
244  bool isPointerConversionToBool() const;
245  bool isPointerConversionToVoidPointer(ASTContext& Context) const;
246  void dump() const;
247  };
248 
249  /// UserDefinedConversionSequence - Represents a user-defined
250  /// conversion sequence (C++ 13.3.3.1.2).
252  /// \brief Represents the standard conversion that occurs before
253  /// the actual user-defined conversion.
254  ///
255  /// C++11 13.3.3.1.2p1:
256  /// If the user-defined conversion is specified by a constructor
257  /// (12.3.1), the initial standard conversion sequence converts
258  /// the source type to the type required by the argument of the
259  /// constructor. If the user-defined conversion is specified by
260  /// a conversion function (12.3.2), the initial standard
261  /// conversion sequence converts the source type to the implicit
262  /// object parameter of the conversion function.
264 
265  /// EllipsisConversion - When this is true, it means user-defined
266  /// conversion sequence starts with a ... (ellipsis) conversion, instead of
267  /// a standard conversion. In this case, 'Before' field must be ignored.
268  // FIXME. I much rather put this as the first field. But there seems to be
269  // a gcc code gen. bug which causes a crash in a test. Putting it here seems
270  // to work around the crash.
272 
273  /// HadMultipleCandidates - When this is true, it means that the
274  /// conversion function was resolved from an overloaded set having
275  /// size greater than 1.
277 
278  /// After - Represents the standard conversion that occurs after
279  /// the actual user-defined conversion.
281 
282  /// ConversionFunction - The function that will perform the
283  /// user-defined conversion. Null if the conversion is an
284  /// aggregate initialization from an initializer list.
286 
287  /// \brief The declaration that we found via name lookup, which might be
288  /// the same as \c ConversionFunction or it might be a using declaration
289  /// that refers to \c ConversionFunction.
291 
292  void dump() const;
293  };
294 
295  /// Represents an ambiguous user-defined conversion sequence.
298 
299  void *FromTypePtr;
300  void *ToTypePtr;
301  char Buffer[sizeof(ConversionSet)];
302 
304  return QualType::getFromOpaquePtr(FromTypePtr);
305  }
306  QualType getToType() const {
307  return QualType::getFromOpaquePtr(ToTypePtr);
308  }
309  void setFromType(QualType T) { FromTypePtr = T.getAsOpaquePtr(); }
310  void setToType(QualType T) { ToTypePtr = T.getAsOpaquePtr(); }
311 
312  ConversionSet &conversions() {
313  return *reinterpret_cast<ConversionSet*>(Buffer);
314  }
315 
316  const ConversionSet &conversions() const {
317  return *reinterpret_cast<const ConversionSet*>(Buffer);
318  }
319 
321  conversions().push_back(std::make_pair(Found, D));
322  }
323 
324  typedef ConversionSet::iterator iterator;
325  iterator begin() { return conversions().begin(); }
326  iterator end() { return conversions().end(); }
327 
328  typedef ConversionSet::const_iterator const_iterator;
329  const_iterator begin() const { return conversions().begin(); }
330  const_iterator end() const { return conversions().end(); }
331 
332  void construct();
333  void destruct();
334  void copyFrom(const AmbiguousConversionSequence &);
335  };
336 
337  /// BadConversionSequence - Records information about an invalid
338  /// conversion sequence.
340  enum FailureKind {
345  rvalue_ref_to_lvalue
346  };
347 
348  // This can be null, e.g. for implicit object arguments.
350 
352 
353  private:
354  // The type we're converting from (an opaque QualType).
355  void *FromTy;
356 
357  // The type we're converting to (an opaque QualType).
358  void *ToTy;
359 
360  public:
361  void init(FailureKind K, Expr *From, QualType To) {
362  init(K, From->getType(), To);
363  FromExpr = From;
364  }
365  void init(FailureKind K, QualType From, QualType To) {
366  Kind = K;
367  FromExpr = nullptr;
368  setFromType(From);
369  setToType(To);
370  }
371 
372  QualType getFromType() const { return QualType::getFromOpaquePtr(FromTy); }
374 
375  void setFromExpr(Expr *E) {
376  FromExpr = E;
377  setFromType(E->getType());
378  }
379  void setFromType(QualType T) { FromTy = T.getAsOpaquePtr(); }
380  void setToType(QualType T) { ToTy = T.getAsOpaquePtr(); }
381  };
382 
383  /// ImplicitConversionSequence - Represents an implicit conversion
384  /// sequence, which may be a standard conversion sequence
385  /// (C++ 13.3.3.1.1), user-defined conversion sequence (C++ 13.3.3.1.2),
386  /// or an ellipsis conversion sequence (C++ 13.3.3.1.3).
388  public:
389  /// Kind - The kind of implicit conversion sequence. BadConversion
390  /// specifies that there is no conversion from the source type to
391  /// the target type. AmbiguousConversion represents the unique
392  /// ambiguous conversion (C++0x [over.best.ics]p10).
393  enum Kind {
394  StandardConversion = 0,
398  BadConversion
399  };
400 
401  private:
402  enum {
403  Uninitialized = BadConversion + 1
404  };
405 
406  /// ConversionKind - The kind of implicit conversion sequence.
407  unsigned ConversionKind : 30;
408 
409  /// \brief Whether the target is really a std::initializer_list, and the
410  /// sequence only represents the worst element conversion.
411  unsigned StdInitializerListElement : 1;
412 
413  void setKind(Kind K) {
414  destruct();
415  ConversionKind = K;
416  }
417 
418  void destruct() {
419  if (ConversionKind == AmbiguousConversion) Ambiguous.destruct();
420  }
421 
422  public:
423  union {
424  /// When ConversionKind == StandardConversion, provides the
425  /// details of the standard conversion sequence.
427 
428  /// When ConversionKind == UserDefinedConversion, provides the
429  /// details of the user-defined conversion sequence.
431 
432  /// When ConversionKind == AmbiguousConversion, provides the
433  /// details of the ambiguous conversion.
435 
436  /// When ConversionKind == BadConversion, provides the details
437  /// of the bad conversion.
439  };
440 
442  : ConversionKind(Uninitialized), StdInitializerListElement(false) {
443  Standard.setAsIdentityConversion();
444  }
446  destruct();
447  }
449  : ConversionKind(Other.ConversionKind),
450  StdInitializerListElement(Other.StdInitializerListElement)
451  {
452  switch (ConversionKind) {
453  case Uninitialized: break;
454  case StandardConversion: Standard = Other.Standard; break;
455  case UserDefinedConversion: UserDefined = Other.UserDefined; break;
456  case AmbiguousConversion: Ambiguous.copyFrom(Other.Ambiguous); break;
457  case EllipsisConversion: break;
458  case BadConversion: Bad = Other.Bad; break;
459  }
460  }
461 
464  destruct();
465  new (this) ImplicitConversionSequence(Other);
466  return *this;
467  }
468 
469  Kind getKind() const {
470  assert(isInitialized() && "querying uninitialized conversion");
471  return Kind(ConversionKind);
472  }
473 
474  /// \brief Return a ranking of the implicit conversion sequence
475  /// kind, where smaller ranks represent better conversion
476  /// sequences.
477  ///
478  /// In particular, this routine gives user-defined conversion
479  /// sequences and ambiguous conversion sequences the same rank,
480  /// per C++ [over.best.ics]p10.
481  unsigned getKindRank() const {
482  switch (getKind()) {
483  case StandardConversion:
484  return 0;
485 
486  case UserDefinedConversion:
487  case AmbiguousConversion:
488  return 1;
489 
490  case EllipsisConversion:
491  return 2;
492 
493  case BadConversion:
494  return 3;
495  }
496 
497  llvm_unreachable("Invalid ImplicitConversionSequence::Kind!");
498  }
499 
500  bool isBad() const { return getKind() == BadConversion; }
501  bool isStandard() const { return getKind() == StandardConversion; }
502  bool isEllipsis() const { return getKind() == EllipsisConversion; }
503  bool isAmbiguous() const { return getKind() == AmbiguousConversion; }
504  bool isUserDefined() const { return getKind() == UserDefinedConversion; }
505  bool isFailure() const { return isBad() || isAmbiguous(); }
506 
507  /// Determines whether this conversion sequence has been
508  /// initialized. Most operations should never need to query
509  /// uninitialized conversions and should assert as above.
510  bool isInitialized() const { return ConversionKind != Uninitialized; }
511 
512  /// Sets this sequence as a bad conversion for an explicit argument.
514  Expr *FromExpr, QualType ToType) {
515  setKind(BadConversion);
516  Bad.init(Failure, FromExpr, ToType);
517  }
518 
519  /// Sets this sequence as a bad conversion for an implicit argument.
521  QualType FromType, QualType ToType) {
522  setKind(BadConversion);
523  Bad.init(Failure, FromType, ToType);
524  }
525 
526  void setStandard() { setKind(StandardConversion); }
527  void setEllipsis() { setKind(EllipsisConversion); }
528  void setUserDefined() { setKind(UserDefinedConversion); }
529  void setAmbiguous() {
530  if (ConversionKind == AmbiguousConversion) return;
531  ConversionKind = AmbiguousConversion;
532  Ambiguous.construct();
533  }
534 
536  setStandard();
537  Standard.setAsIdentityConversion();
538  Standard.setFromType(T);
539  Standard.setAllToTypes(T);
540  }
541 
542  /// \brief Whether the target is really a std::initializer_list, and the
543  /// sequence only represents the worst element conversion.
545  return StdInitializerListElement;
546  }
547 
548  void setStdInitializerListElement(bool V = true) {
549  StdInitializerListElement = V;
550  }
551 
552  // The result of a comparison between implicit conversion
553  // sequences. Use Sema::CompareImplicitConversionSequences to
554  // actually perform the comparison.
555  enum CompareKind {
556  Better = -1,
557  Indistinguishable = 0,
558  Worse = 1
559  };
560 
561  void DiagnoseAmbiguousConversion(Sema &S,
562  SourceLocation CaretLoc,
563  const PartialDiagnostic &PDiag) const;
564 
565  void dump() const;
566  };
567 
573 
574  /// This conversion candidate was not considered because it
575  /// duplicates the work of a trivial or derived-to-base
576  /// conversion.
578 
579  /// This conversion candidate was not considered because it is
580  /// an illegal instantiation of a constructor temploid: it is
581  /// callable with one argument, we only have one argument, and
582  /// its first parameter type is exactly the type of the class.
583  ///
584  /// Defining such a constructor directly is illegal, and
585  /// template-argument deduction is supposed to ignore such
586  /// instantiations, but we can still get one with the right
587  /// kind of implicit instantiation.
589 
590  /// This conversion candidate is not viable because its result
591  /// type is not implicitly convertible to the desired type.
593 
594  /// This conversion function template specialization candidate is not
595  /// viable because the final conversion was not an exact match.
597 
598  /// (CUDA) This candidate was not viable because the callee
599  /// was not accessible from the caller's target (i.e. host->device,
600  /// global->host, device->host).
602 
603  /// This candidate function was not viable because an enable_if
604  /// attribute disabled it.
606 
607  /// This candidate was not viable because its address could not be taken.
609 
610  /// This candidate was not viable because its OpenCL extension is disabled.
612 
613  /// This inherited constructor is not viable because it would slice the
614  /// argument.
616  };
617 
618  /// A list of implicit conversion sequences for the arguments of an
619  /// OverloadCandidate.
622 
623  /// OverloadCandidate - A single candidate in an overload set (C++ 13.3).
625  /// Function - The actual function that this candidate
626  /// represents. When NULL, this is a built-in candidate
627  /// (C++ [over.oper]) or a surrogate for a conversion to a
628  /// function pointer or reference (C++ [over.call.object]).
630 
631  /// FoundDecl - The original declaration that was looked up /
632  /// invented / otherwise found, together with its access.
633  /// Might be a UsingShadowDecl or a FunctionTemplateDecl.
635 
636  /// BuiltinParamTypes - Provides the parameter types of a built-in overload
637  /// candidate. Only valid when Function is NULL.
638  QualType BuiltinParamTypes[3];
639 
640  /// Surrogate - The conversion function for which this candidate
641  /// is a surrogate, but only if IsSurrogate is true.
643 
644  /// The conversion sequences used to convert the function arguments
645  /// to the function parameters.
647 
648  /// The FixIt hints which can be used to fix the Bad candidate.
650 
651  /// Viable - True to indicate that this overload candidate is viable.
652  bool Viable;
653 
654  /// IsSurrogate - True to indicate that this candidate is a
655  /// surrogate for a conversion to a function pointer or reference
656  /// (C++ [over.call.object]).
658 
659  /// IgnoreObjectArgument - True to indicate that the first
660  /// argument's conversion, which for this function represents the
661  /// implicit object argument, should be ignored. This will be true
662  /// when the candidate is a static member function (where the
663  /// implicit object argument is just a placeholder) or a
664  /// non-static member function when the call doesn't have an
665  /// object argument.
667 
668  /// FailureKind - The reason why this candidate is not viable.
669  /// Actually an OverloadFailureKind.
670  unsigned char FailureKind;
671 
672  /// \brief The number of call arguments that were explicitly provided,
673  /// to be used while performing partial ordering of function templates.
675 
676  union {
678 
679  /// FinalConversion - For a conversion function (where Function is
680  /// a CXXConversionDecl), the standard conversion that occurs
681  /// after the call to the overload candidate to convert the result
682  /// of calling the conversion function to the required type.
684  };
685 
686  /// hasAmbiguousConversion - Returns whether this overload
687  /// candidate requires an ambiguous conversion or not.
688  bool hasAmbiguousConversion() const {
689  for (auto &C : Conversions) {
690  if (!C.isInitialized()) return false;
691  if (C.isAmbiguous()) return true;
692  }
693  return false;
694  }
695 
696  bool TryToFixBadConversion(unsigned Idx, Sema &S) {
697  bool CanFix = Fix.tryToFixConversion(
698  Conversions[Idx].Bad.FromExpr,
699  Conversions[Idx].Bad.getFromType(),
700  Conversions[Idx].Bad.getToType(), S);
701 
702  // If at least one conversion fails, the candidate cannot be fixed.
703  if (!CanFix)
704  Fix.clear();
705 
706  return CanFix;
707  }
708 
709  unsigned getNumParams() const {
710  if (IsSurrogate) {
711  auto STy = Surrogate->getConversionType();
712  while (STy->isPointerType() || STy->isReferenceType())
713  STy = STy->getPointeeType();
714  return STy->getAs<FunctionProtoType>()->getNumParams();
715  }
716  if (Function)
717  return Function->getNumParams();
718  return ExplicitCallArguments;
719  }
720  };
721 
722  /// OverloadCandidateSet - A set of overload candidates, used in C++
723  /// overload resolution (C++ 13.3).
725  public:
727  /// Normal lookup.
729  /// C++ [over.match.oper]:
730  /// Lookup of operator function candidates in a call using operator
731  /// syntax. Candidates that have no parameters of class type will be
732  /// skipped unless there is a parameter of (reference to) enum type and
733  /// the corresponding argument is of the same enum type.
735  /// C++ [over.match.copy]:
736  /// Copy-initialization of an object of class type by user-defined
737  /// conversion.
739  /// C++ [over.match.ctor], [over.match.list]
740  /// Initialization of an object of class type by constructor,
741  /// using either a parenthesized or braced list of arguments.
743  };
744 
745  private:
747  llvm::SmallPtrSet<Decl *, 16> Functions;
748 
749  // Allocator for ConversionSequenceLists. We store the first few of these
750  // inline to avoid allocation for small sets.
751  llvm::BumpPtrAllocator SlabAllocator;
752 
753  SourceLocation Loc;
755 
756  constexpr static unsigned NumInlineBytes =
757  24 * sizeof(ImplicitConversionSequence);
758  unsigned NumInlineBytesUsed;
759  llvm::AlignedCharArray<alignof(void *), NumInlineBytes> InlineSpace;
760 
761  /// If we have space, allocates from inline storage. Otherwise, allocates
762  /// from the slab allocator.
763  /// FIXME: It would probably be nice to have a SmallBumpPtrAllocator
764  /// instead.
765  /// FIXME: Now that this only allocates ImplicitConversionSequences, do we
766  /// want to un-generalize this?
767  template <typename T>
768  T *slabAllocate(unsigned N) {
769  // It's simpler if this doesn't need to consider alignment.
770  static_assert(alignof(T) == alignof(void *),
771  "Only works for pointer-aligned types.");
772  static_assert(std::is_trivial<T>::value ||
773  std::is_same<ImplicitConversionSequence, T>::value,
774  "Add destruction logic to OverloadCandidateSet::clear().");
775 
776  unsigned NBytes = sizeof(T) * N;
777  if (NBytes > NumInlineBytes - NumInlineBytesUsed)
778  return SlabAllocator.Allocate<T>(N);
779  char *FreeSpaceStart = InlineSpace.buffer + NumInlineBytesUsed;
780  assert(uintptr_t(FreeSpaceStart) % alignof(void *) == 0 &&
781  "Misaligned storage!");
782 
783  NumInlineBytesUsed += NBytes;
784  return reinterpret_cast<T *>(FreeSpaceStart);
785  }
786 
787  OverloadCandidateSet(const OverloadCandidateSet &) = delete;
788  void operator=(const OverloadCandidateSet &) = delete;
789 
790  void destroyCandidates();
791 
792  public:
794  : Loc(Loc), Kind(CSK), NumInlineBytesUsed(0) {}
795  ~OverloadCandidateSet() { destroyCandidates(); }
796 
797  SourceLocation getLocation() const { return Loc; }
798  CandidateSetKind getKind() const { return Kind; }
799 
800  /// \brief Determine when this overload candidate will be new to the
801  /// overload set.
802  bool isNewCandidate(Decl *F) {
803  return Functions.insert(F->getCanonicalDecl()).second;
804  }
805 
806  /// \brief Clear out all of the candidates.
807  void clear(CandidateSetKind CSK);
808 
810  iterator begin() { return Candidates.begin(); }
811  iterator end() { return Candidates.end(); }
812 
813  size_t size() const { return Candidates.size(); }
814  bool empty() const { return Candidates.empty(); }
815 
816  /// \brief Allocate storage for conversion sequences for NumConversions
817  /// conversions.
819  allocateConversionSequences(unsigned NumConversions) {
820  ImplicitConversionSequence *Conversions =
821  slabAllocate<ImplicitConversionSequence>(NumConversions);
822 
823  // Construct the new objects.
824  for (unsigned I = 0; I != NumConversions; ++I)
825  new (&Conversions[I]) ImplicitConversionSequence();
826 
827  return ConversionSequenceList(Conversions, NumConversions);
828  }
829 
830  /// \brief Add a new candidate with NumConversions conversion sequence slots
831  /// to the overload set.
832  OverloadCandidate &addCandidate(unsigned NumConversions = 0,
833  ConversionSequenceList Conversions = None) {
834  assert((Conversions.empty() || Conversions.size() == NumConversions) &&
835  "preallocated conversion sequence has wrong length");
836 
837  Candidates.push_back(OverloadCandidate());
838  OverloadCandidate &C = Candidates.back();
839  C.Conversions = Conversions.empty()
840  ? allocateConversionSequences(NumConversions)
841  : Conversions;
842  return C;
843  }
844 
845  /// Find the best viable function on this overload set, if it exists.
846  OverloadingResult BestViableFunction(Sema &S, SourceLocation Loc,
848 
849  void NoteCandidates(Sema &S,
851  ArrayRef<Expr *> Args,
852  StringRef Opc = "",
854  llvm::function_ref<bool(OverloadCandidate&)> Filter =
855  [](OverloadCandidate&) { return true; });
856  };
857 
859  const OverloadCandidate &Cand1,
860  const OverloadCandidate &Cand2,
861  SourceLocation Loc,
863 
868  explicit operator bool() const { return Constructor; }
869  };
870  // FIXME: Add an AddOverloadCandidate / AddTemplateOverloadCandidate overload
871  // that takes one of these.
873  if (isa<UsingDecl>(ND))
874  return ConstructorInfo{};
875 
876  // For constructors, the access check is performed against the underlying
877  // declaration, not the found declaration.
878  auto *D = ND->getUnderlyingDecl();
879  ConstructorInfo Info = {DeclAccessPair::make(ND, D->getAccess()), nullptr,
880  nullptr};
881  Info.ConstructorTmpl = dyn_cast<FunctionTemplateDecl>(D);
882  if (Info.ConstructorTmpl)
883  D = Info.ConstructorTmpl->getTemplatedDecl();
884  Info.Constructor = dyn_cast<CXXConstructorDecl>(D);
885  return Info;
886  }
887 } // end namespace clang
888 
889 #endif // LLVM_CLANG_SEMA_OVERLOAD_H
unsigned ExplicitCallArguments
The number of call arguments that were explicitly provided, to be used while performing partial order...
Definition: Overload.h:674
DeclAccessPair FoundConversionFunction
The declaration that we found via name lookup, which might be the same as ConversionFunction or it mi...
Definition: Overload.h:290
Function pointer conversion (C++17 4.13)
Definition: Overload.h:65
unsigned DeprecatedStringLiteralToCharPtr
Whether this is the deprecated conversion of a string literal to a pointer to non-const character dat...
Definition: Overload.h:161
(CUDA) This candidate was not viable because the callee was not accessible from the caller&#39;s target (...
Definition: Overload.h:601
void setFromType(QualType T)
Definition: Overload.h:379
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
Definition: Decl.h:1698
void setStdInitializerListElement(bool V=true)
Definition: Overload.h:548
bool EllipsisConversion
EllipsisConversion - When this is true, it means user-defined conversion sequence starts with a ...
Definition: Overload.h:271
A (possibly-)qualified type.
Definition: Type.h:653
ImplicitConversionKind
ImplicitConversionKind - The kind of implicit conversion used to convert an argument to a parameter&#39;s...
Definition: Overload.h:60
void setFromType(QualType T)
Definition: Overload.h:215
Conversion not allowed by the C standard, but that we accept as an extension anyway.
Definition: Overload.h:106
llvm::MutableArrayRef< ImplicitConversionSequence > ConversionSequenceList
A list of implicit conversion sequences for the arguments of an OverloadCandidate.
Definition: Overload.h:621
A structure used to record information about a failed template argument deduction, for diagnosis.
Cannot tell whether this is a narrowing conversion because the expression is value-dependent.
Definition: Overload.h:130
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
Definition: Type.cpp:456
Vector conversions.
Definition: Overload.h:79
C Language Family Type Representation.
bool tryToFixConversion(const Expr *FromExpr, const QualType FromQTy, const QualType ToQTy, Sema &S)
If possible, generates and stores a fix for the given conversion.
Complex conversions (C99 6.3.1.6)
Definition: Overload.h:72
UserDefinedConversionSequence UserDefined
When ConversionKind == UserDefinedConversion, provides the details of the user-defined conversion seq...
Definition: Overload.h:430
ConstructorInfo getConstructorInfo(NamedDecl *ND)
Definition: Overload.h:872
bool isBetterOverloadCandidate(Sema &S, const OverloadCandidate &Cand1, const OverloadCandidate &Cand2, SourceLocation Loc, OverloadCandidateSet::CandidateSetKind Kind)
isBetterOverloadCandidate - Determines whether the first overload candidate is a better candidate tha...
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
Defines the C++ template declaration subclasses.
Not a narrowing conversion.
Definition: Overload.h:116
ImplicitConversionRank
ImplicitConversionRank - The rank of an implicit conversion kind.
Definition: Overload.h:97
unsigned IncompatibleObjC
IncompatibleObjC - Whether this is an Objective-C conversion that we should warn about (if we actuall...
Definition: Overload.h:169
virtual void clear()
Ambiguous candidates found.
Definition: Overload.h:43
Conversions between compatible types in C99.
Definition: Overload.h:77
bool IgnoreObjectArgument
IgnoreObjectArgument - True to indicate that the first argument&#39;s conversion, which for this function...
Definition: Overload.h:666
ConversionSet::iterator iterator
Definition: Overload.h:324
QualType getConversionType() const
Returns the type that this conversion function is converting to.
Definition: DeclCXX.h:2717
unsigned DirectBinding
DirectBinding - True when this is a reference binding that is a direct binding (C++ [dcl...
Definition: Overload.h:177
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2397
Exact Match.
Definition: Overload.h:98
bool hasAmbiguousConversion() const
hasAmbiguousConversion - Returns whether this overload candidate requires an ambiguous conversion or ...
Definition: Overload.h:688
QualType getFromType() const
Definition: Overload.h:226
const T * getAs() const
Member-template getAs<specific type>&#39;.
Definition: Type.h:6307
bool IsSurrogate
IsSurrogate - True to indicate that this candidate is a surrogate for a conversion to a function poin...
Definition: Overload.h:657
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
Definition: Decl.h:423
bool HadMultipleCandidates
HadMultipleCandidates - When this is true, it means that the conversion function was resolved from an...
Definition: Overload.h:276
Conversion.
Definition: Overload.h:100
void * ToTypePtrs[3]
ToType - The types that this conversion is converting to in each step.
Definition: Overload.h:205
OverloadCandidate & addCandidate(unsigned NumConversions=0, ConversionSequenceList Conversions=None)
Add a new candidate with NumConversions conversion sequence slots to the overload set...
Definition: Overload.h:832
ImplicitConversionSequence(const ImplicitConversionSequence &Other)
Definition: Overload.h:448
Boolean conversions (C++ 4.12)
Definition: Overload.h:76
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:149
unsigned BindsToFunctionLvalue
Whether we&#39;re binding to a function lvalue.
Definition: Overload.h:184
C++ [over.match.copy]: Copy-initialization of an object of class type by user-defined conversion...
Definition: Overload.h:738
BadConversionSequence Bad
When ConversionKind == BadConversion, provides the details of the bad conversion. ...
Definition: Overload.h:438
Identity conversion (no conversion)
Definition: Overload.h:61
bool isStdInitializerListElement() const
Whether the target is really a std::initializer_list, and the sequence only represents the worst elem...
Definition: Overload.h:544
Kind
Kind - The kind of implicit conversion sequence.
Definition: Overload.h:393
ConversionSet & conversions()
Definition: Overload.h:312
BadConversionSequence - Records information about an invalid conversion sequence. ...
Definition: Overload.h:339
Floating point conversions (C++ 4.8)
Definition: Overload.h:71
ConversionSequenceList allocateConversionSequences(unsigned NumConversions)
Allocate storage for conversion sequences for NumConversions conversions.
Definition: Overload.h:819
OverloadCandidateDisplayKind
Definition: Overload.h:47
Floating point promotions (C++ 4.6)
Definition: Overload.h:68
bool isInitialized() const
Determines whether this conversion sequence has been initialized.
Definition: Overload.h:510
unsigned BindsToRvalue
Whether we&#39;re binding to an rvalue.
Definition: Overload.h:187
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
Succeeded, but refers to a deleted function.
Definition: Overload.h:44
ImplicitConversionSequence & operator=(const ImplicitConversionSequence &Other)
Definition: Overload.h:463
unsigned QualificationIncludesObjCLifetime
Whether the qualification conversion involves a change in the Objective-C lifetime (for automatic ref...
Definition: Overload.h:165
QualType getToType(unsigned Idx) const
Definition: Overload.h:229
This candidate function was not viable because an enable_if attribute disabled it.
Definition: Overload.h:605
ImplicitConversionKind Second
Second - The second conversion can be an integral promotion, floating point promotion, integral conversion, floating point conversion, floating-integral conversion, pointer conversion, pointer-to-member conversion, or boolean conversion.
Definition: Overload.h:152
A narrowing conversion, because a constant expression got narrowed.
Definition: Overload.h:122
unsigned IsLvalueReference
Whether this is an lvalue reference binding (otherwise, it&#39;s an rvalue reference binding).
Definition: Overload.h:181
NarrowingKind
NarrowingKind - The kind of narrowing conversion being performed by a standard conversion sequence ac...
Definition: Overload.h:114
Qualification conversions (C++ 4.4)
Definition: Overload.h:66
void * getAsOpaquePtr() const
Definition: Type.h:699
The number of conversion kinds.
Definition: Overload.h:90
ImplicitConversionKind Third
Third - The third conversion can be a qualification conversion or a function conversion.
Definition: Overload.h:156
Complex <-> Real conversion.
Definition: Overload.h:102
bool Viable
Viable - True to indicate that this overload candidate is viable.
Definition: Overload.h:652
ConversionSequenceList Conversions
The conversion sequences used to convert the function arguments to the function parameters.
Definition: Overload.h:646
Integral promotions (C++ 4.5)
Definition: Overload.h:67
This conversion function template specialization candidate is not viable because the final conversion...
Definition: Overload.h:596
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:865
void setAsIdentityConversion(QualType T)
Definition: Overload.h:535
C-only conversion between pointers with incompatible types.
Definition: Overload.h:88
DeclAccessPair FoundDecl
Definition: Overload.h:865
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:274
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3270
Transparent Union Conversions.
Definition: Overload.h:83
This conversion candidate was not considered because it duplicates the work of a trivial or derived-t...
Definition: Overload.h:577
CandidateSetKind getKind() const
Definition: Overload.h:798
bool isNewCandidate(Decl *F)
Determine when this overload candidate will be new to the overload set.
Definition: Overload.h:802
A narrowing conversion by virtue of the source and destination types.
Definition: Overload.h:119
Promotion.
Definition: Overload.h:99
StandardConversionSequence FinalConversion
FinalConversion - For a conversion function (where Function is a CXXConversionDecl), the standard conversion that occurs after the call to the overload candidate to convert the result of calling the conversion function to the required type.
Definition: Overload.h:683
ObjC ARC writeback conversion.
Definition: Overload.h:103
OpenCL Scalar Widening.
Definition: Overload.h:101
Expr - This represents one expression.
Definition: Expr.h:106
Represents an ambiguous user-defined conversion sequence.
Definition: Overload.h:296
This inherited constructor is not viable because it would slice the argument.
Definition: Overload.h:615
const FunctionProtoType * T
SourceLocation getLocation() const
Definition: Overload.h:797
StandardConversionSequence After
After - Represents the standard conversion that occurs after the actual user-defined conversion...
Definition: Overload.h:280
Zero constant to queue.
Definition: Overload.h:86
SmallVectorImpl< OverloadCandidate >::iterator iterator
Definition: Overload.h:809
#define bool
Definition: stdbool.h:31
CXXConstructorDecl * CopyConstructor
CopyConstructor - The copy constructor that is used to perform this conversion, when the conversion i...
Definition: Overload.h:212
Overload resolution succeeded.
Definition: Overload.h:41
unsigned ReferenceBinding
ReferenceBinding - True when this is a reference binding (C++ [over.ics.ref]).
Definition: Overload.h:173
Floating-integral conversions (C++ 4.9)
Definition: Overload.h:73
void init(FailureKind K, Expr *From, QualType To)
Definition: Overload.h:361
This conversion candidate was not considered because it is an illegal instantiation of a constructor ...
Definition: Overload.h:588
bool TryToFixBadConversion(unsigned Idx, Sema &S)
Definition: Overload.h:696
QualType getType() const
Definition: Expr.h:128
CXXConversionDecl * Surrogate
Surrogate - The conversion function for which this candidate is a surrogate, but only if IsSurrogate ...
Definition: Overload.h:642
UserDefinedConversionSequence - Represents a user-defined conversion sequence (C++ 13...
Definition: Overload.h:251
This candidate was not viable because its address could not be taken.
Definition: Overload.h:608
const ConversionSet & conversions() const
Definition: Overload.h:316
StandardConversionSequence Standard
When ConversionKind == StandardConversion, provides the details of the standard conversion sequence...
Definition: Overload.h:426
Represents a C++ conversion function within a class.
Definition: DeclCXX.h:2682
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Definition: opencl-c.h:82
A narrowing conversion, because a non-constant-expression variable might have got narrowed...
Definition: Overload.h:126
QualType getFromType() const
Definition: Overload.h:372
Lvalue-to-rvalue conversion (C++ 4.1)
Definition: Overload.h:62
OverloadFailureKind
Definition: Overload.h:568
unsigned ObjCLifetimeConversionBinding
Whether this binds a reference to an object with a different Objective-C lifetime qualifier...
Definition: Overload.h:195
CXXConstructorDecl * Constructor
Definition: Overload.h:866
Integral conversions (C++ 4.7)
Definition: Overload.h:70
Complex promotions (Clang extension)
Definition: Overload.h:69
#define false
Definition: stdbool.h:33
Kind
ImplicitConversionSequence - Represents an implicit conversion sequence, which may be a standard conv...
Definition: Overload.h:387
bool isPointerConversionToVoidPointer(ASTContext &Context) const
isPointerConversionToVoidPointer - Determines whether this conversion is a conversion of a pointer to...
SmallVector< std::pair< NamedDecl *, FunctionDecl * >, 4 > ConversionSet
Definition: Overload.h:297
OverloadCandidate - A single candidate in an overload set (C++ 13.3).
Definition: Overload.h:624
NarrowingKind getNarrowingKind(ASTContext &Context, const Expr *Converted, APValue &ConstantValue, QualType &ConstantType) const
Check if this standard conversion sequence represents a narrowing conversion, according to C++11 [dcl...
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Encodes a location in the source.
C++ [over.match.ctor], [over.match.list] Initialization of an object of class type by constructor...
Definition: Overload.h:742
A vector splat from an arithmetic type.
Definition: Overload.h:80
OverloadingResult
OverloadingResult - Capture the result of performing overload resolution.
Definition: Overload.h:40
Objective-C ARC writeback conversion.
Definition: Overload.h:84
void init(FailureKind K, QualType From, QualType To)
Definition: Overload.h:365
void setAsIdentityConversion()
StandardConversionSequence - Set the standard conversion sequence to the identity conversion...
Pointer conversions (C++ 4.10)
Definition: Overload.h:74
C++ [over.match.oper]: Lookup of operator function candidates in a call using operator syntax...
Definition: Overload.h:734
Requests that all candidates be shown.
Definition: Overload.h:50
Derived-to-base (C++ [over.best.ics])
Definition: Overload.h:78
Complex-real conversions (C99 6.3.1.7)
Definition: Overload.h:81
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13...
Definition: Overload.h:724
void setBad(BadConversionSequence::FailureKind Failure, Expr *FromExpr, QualType ToType)
Sets this sequence as a bad conversion for an explicit argument.
Definition: Overload.h:513
static QualType getFromOpaquePtr(const void *Ptr)
Definition: Type.h:701
void setFromExpr(Expr *E)
Definition: Overload.h:375
unsigned getNumParams() const
Definition: Overload.h:709
bool isPointerConversionToBool() const
isPointerConversionToBool - Determines whether this conversion is a conversion of a pointer or pointe...
A POD class for pairing a NamedDecl* with an access specifier.
ImplicitConversionRank GetConversionRank(ImplicitConversionKind Kind)
GetConversionRank - Retrieve the implicit conversion rank corresponding to the given implicit convers...
DeclAccessPair FoundCopyConstructor
Definition: Overload.h:213
OverloadCandidateSet(SourceLocation Loc, CandidateSetKind CSK)
Definition: Overload.h:793
Dataflow Directional Tag Classes.
ConversionSet::const_iterator const_iterator
Definition: Overload.h:328
AccessSpecifier getAccess() const
Definition: DeclBase.h:460
Conversions allowed in C, but not C++.
Definition: Overload.h:87
Array-to-pointer conversion (C++ 4.2)
Definition: Overload.h:63
StandardConversionSequence Before
Represents the standard conversion that occurs before the actual user-defined conversion.
Definition: Overload.h:263
Requests that only viable candidates be shown.
Definition: Overload.h:53
FunctionDecl * Function
Function - The actual function that this candidate represents.
Definition: Overload.h:629
FunctionDecl * ConversionFunction
ConversionFunction - The function that will perform the user-defined conversion.
Definition: Overload.h:285
Conversion only allowed in the C standard.
Definition: Overload.h:104
void setToType(QualType T)
Definition: Overload.h:380
void setAllToTypes(QualType T)
Definition: Overload.h:220
unsigned getKindRank() const
Return a ranking of the implicit conversion sequence kind, where smaller ranks represent better conve...
Definition: Overload.h:481
This candidate was not viable because its OpenCL extension is disabled.
Definition: Overload.h:611
unsigned BindsImplicitObjectArgumentWithoutRefQualifier
Whether this binds an implicit object argument to a non-static member function without a ref-qualifie...
Definition: Overload.h:191
unsigned char FailureKind
FailureKind - The reason why this candidate is not viable.
Definition: Overload.h:670
void setBad(BadConversionSequence::FailureKind Failure, QualType FromType, QualType ToType)
Sets this sequence as a bad conversion for an implicit argument.
Definition: Overload.h:520
DeclAccessPair FoundDecl
FoundDecl - The original declaration that was looked up / invented / otherwise found, together with its access.
Definition: Overload.h:634
Block Pointer conversions.
Definition: Overload.h:82
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
Definition: APValue.h:38
ConversionFixItGenerator Fix
The FixIt hints which can be used to fix the Bad candidate.
Definition: Overload.h:649
AmbiguousConversionSequence Ambiguous
When ConversionKind == AmbiguousConversion, provides the details of the ambiguous conversion...
Definition: Overload.h:434
void addConversion(NamedDecl *Found, FunctionDecl *D)
Definition: Overload.h:320
Function-to-pointer (C++ 4.3)
Definition: Overload.h:64
QualType getToType() const
Definition: Overload.h:373
FunctionTemplateDecl * ConstructorTmpl
Definition: Overload.h:867
const_iterator begin() const
Definition: Overload.h:329
void * FromTypePtr
FromType - The type that this conversion is converting from.
Definition: Overload.h:200
ImplicitConversionRank getRank() const
getRank - Retrieve the rank of this standard conversion sequence (C++ 13.3.3.1.1p3).
static Decl::Kind getKind(const Decl *D)
Definition: DeclBase.cpp:915
The class facilities generation and storage of conversion FixIts.
Zero constant to event (OpenCL1.2 6.12.10)
Definition: Overload.h:85
ImplicitConversionKind First
First – The first conversion can be an lvalue-to-rvalue conversion, array-to-pointer conversion...
Definition: Overload.h:146
No viable function found.
Definition: Overload.h:42
DeductionFailureInfo DeductionFailure
Definition: Overload.h:677
NamedDecl - This represents a decl with a name.
Definition: Decl.h:245
void dump() const
dump - Print this standard conversion sequence to standard error.
Pointer-to-member conversions (C++ 4.11)
Definition: Overload.h:75
void setToType(unsigned Idx, QualType T)
Definition: Overload.h:216
unsigned getNumParams() const
getNumParams - Return the number of parameters this function must have based on its FunctionType...
Definition: Decl.cpp:2906
This conversion candidate is not viable because its result type is not implicitly convertible to the ...
Definition: Overload.h:592
const_iterator end() const
Definition: Overload.h:330
Declaration of a template function.
Definition: DeclTemplate.h:967
StandardConversionSequence - represents a standard conversion sequence (C++ 13.3.3.1.1).
Definition: Overload.h:141