clang API Documentation

Public Types | Public Member Functions | Public Attributes
clang::ImplicitConversionSequence Class Reference

#include <Overload.h>

Collaboration diagram for clang::ImplicitConversionSequence:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Kind {
  StandardConversion = 0, UserDefinedConversion, AmbiguousConversion, EllipsisConversion,
  BadConversion
}
enum  CompareKind { Better = -1, Indistinguishable = 0, Worse = 1 }

Public Member Functions

 ImplicitConversionSequence ()
 ~ImplicitConversionSequence ()
 ImplicitConversionSequence (const ImplicitConversionSequence &Other)
ImplicitConversionSequenceoperator= (const ImplicitConversionSequence &Other)
Kind getKind () const
unsigned getKindRank () const
 Return a ranking of the implicit conversion sequence kind, where smaller ranks represent better conversion sequences.
bool isBad () const
bool isStandard () const
bool isEllipsis () const
bool isAmbiguous () const
bool isUserDefined () const
bool isFailure () const
bool isInitialized () const
void setBad (BadConversionSequence::FailureKind Failure, Expr *FromExpr, QualType ToType)
 Sets this sequence as a bad conversion for an explicit argument.
void setBad (BadConversionSequence::FailureKind Failure, QualType FromType, QualType ToType)
 Sets this sequence as a bad conversion for an implicit argument.
void setStandard ()
void setEllipsis ()
void setUserDefined ()
void setAmbiguous ()
bool isStdInitializerListElement () const
 Whether the target is really a std::initializer_list, and the sequence only represents the worst element conversion.
void setStdInitializerListElement (bool V=true)
void DiagnoseAmbiguousConversion (Sema &S, SourceLocation CaretLoc, const PartialDiagnostic &PDiag) const
void dump () const

Public Attributes

union {
   StandardConversionSequence   Standard
   UserDefinedConversionSequence   UserDefined
   AmbiguousConversionSequence   Ambiguous
   BadConversionSequence   Bad
}; 

Detailed Description

ImplicitConversionSequence - Represents an implicit conversion sequence, which may be a standard conversion sequence (C++ 13.3.3.1.1), user-defined conversion sequence (C++ 13.3.3.1.2), or an ellipsis conversion sequence (C++ 13.3.3.1.3).

Definition at line 372 of file Overload.h.


Member Enumeration Documentation

Enumerator:
Better 
Indistinguishable 
Worse 

Definition at line 532 of file Overload.h.

Kind - The kind of implicit conversion sequence. BadConversion specifies that there is no conversion from the source type to the target type. AmbiguousConversion represents the unique ambiguous conversion (C++0x [over.best.ics]p10).

Enumerator:
StandardConversion 
UserDefinedConversion 
AmbiguousConversion 
EllipsisConversion 
BadConversion 

Definition at line 378 of file Overload.h.


Constructor & Destructor Documentation

Definition at line 426 of file Overload.h.

Referenced by operator=().

Definition at line 429 of file Overload.h.


Member Function Documentation

dump - Print this implicit conversion sequence to standard error. Useful for debugging overloading issues.

Definition at line 479 of file SemaOverload.cpp.

Return a ranking of the implicit conversion sequence kind, where smaller ranks represent better conversion sequences.

In particular, this routine gives user-defined conversion sequences and ambiguous conversion sequences the same rank, per C++ [over.best.ics]p10.

Definition at line 465 of file Overload.h.

References AmbiguousConversion, BadConversion, EllipsisConversion, getKind(), StandardConversion, and UserDefinedConversion.

Referenced by CompareImplicitConversionSequences().

Definition at line 487 of file Overload.h.

References AmbiguousConversion, and getKind().

Referenced by isFailure(), and NoteAmbiguousUserConversions().

Definition at line 486 of file Overload.h.

References EllipsisConversion, and getKind().

Referenced by TryListConversion().

Definition at line 489 of file Overload.h.

References isAmbiguous(), and isBad().

Referenced by clang::Sema::CheckSingleAssignmentConstraints(), and TryListConversion().

Determines whether this conversion sequence has been initialized. Most operations should never need to query uninitialized conversions and should assert as above.

Definition at line 494 of file Overload.h.

Referenced by CompleteNonViableCandidate(), and getKind().

Whether the target is really a std::initializer_list, and the sequence only represents the worst element conversion.

Definition at line 521 of file Overload.h.

Referenced by CompareImplicitConversionSequences().

ImplicitConversionSequence& clang::ImplicitConversionSequence::operator= ( const ImplicitConversionSequence Other) [inline]

Definition at line 447 of file Overload.h.

References ImplicitConversionSequence().

void clang::ImplicitConversionSequence::setBad ( BadConversionSequence::FailureKind  Failure,
Expr FromExpr,
QualType  ToType 
) [inline]

Sets this sequence as a bad conversion for an explicit argument.

Definition at line 497 of file Overload.h.

References Bad, BadConversion, and clang::BadConversionSequence::init().

Referenced by TryImplicitConversion(), TryListConversion(), TryObjectArgumentInitialization(), TryReferenceInit(), and TryUserDefinedConversion().

Sets this sequence as a bad conversion for an implicit argument.

Definition at line 504 of file Overload.h.

References Bad, BadConversion, and clang::BadConversionSequence::init().

Definition at line 525 of file Overload.h.

Referenced by TryListConversion().


Member Data Documentation

union { ... }

When ConversionKind == AmbiguousConversion, provides the details of the ambiguous conversion.

Definition at line 419 of file Overload.h.

Referenced by DiagnoseAmbiguousConversion(), FindConversionForRefInit(), ImplicitConversionSequence(), setAmbiguous(), and TryUserDefinedConversion().

When ConversionKind == BadConversion, provides the details of the bad conversion.

Definition at line 423 of file Overload.h.

Referenced by DiagnoseBadConversion(), ImplicitConversionSequence(), clang::Sema::PerformObjectArgumentInitialization(), setBad(), and clang::OverloadCandidate::TryToFixBadConversion().


The documentation for this class was generated from the following files: