clang
6.0.0
|
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). More...
#include "clang/Sema/Overload.h"
Public Types | |
enum | Kind { StandardConversion = 0, UserDefinedConversion, AmbiguousConversion, EllipsisConversion, BadConversion } |
Kind - The kind of implicit conversion sequence. More... | |
enum | CompareKind { Better = -1, Indistinguishable = 0, Worse = 1 } |
Public Member Functions | |
ImplicitConversionSequence () | |
~ImplicitConversionSequence () | |
ImplicitConversionSequence (const ImplicitConversionSequence &Other) | |
ImplicitConversionSequence & | operator= (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. More... | |
bool | isBad () const |
bool | isStandard () const |
bool | isEllipsis () const |
bool | isAmbiguous () const |
bool | isUserDefined () const |
bool | isFailure () const |
bool | isInitialized () const |
Determines whether this conversion sequence has been initialized. More... | |
void | setBad (BadConversionSequence::FailureKind Failure, Expr *FromExpr, QualType ToType) |
Sets this sequence as a bad conversion for an explicit argument. More... | |
void | setBad (BadConversionSequence::FailureKind Failure, QualType FromType, QualType ToType) |
Sets this sequence as a bad conversion for an implicit argument. More... | |
void | setStandard () |
void | setEllipsis () |
void | setUserDefined () |
void | setAmbiguous () |
void | setAsIdentityConversion (QualType T) |
bool | isStdInitializerListElement () const |
Whether the target is really a std::initializer_list, and the sequence only represents the worst element conversion. More... | |
void | setStdInitializerListElement (bool V=true) |
void | DiagnoseAmbiguousConversion (Sema &S, SourceLocation CaretLoc, const PartialDiagnostic &PDiag) const |
Diagnoses an ambiguous conversion. More... | |
void | dump () const |
dump - Print this implicit conversion sequence to standard error. More... | |
Public Attributes | |
union { | |
StandardConversionSequence Standard | |
When ConversionKind == StandardConversion, provides the details of the standard conversion sequence. More... | |
UserDefinedConversionSequence UserDefined | |
When ConversionKind == UserDefinedConversion, provides the details of the user-defined conversion sequence. More... | |
AmbiguousConversionSequence Ambiguous | |
When ConversionKind == AmbiguousConversion, provides the details of the ambiguous conversion. More... | |
BadConversionSequence Bad | |
When ConversionKind == BadConversion, provides the details of the bad conversion. More... | |
}; | |
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 387 of file Overload.h.
Enumerator | |
---|---|
Better | |
Indistinguishable | |
Worse |
Definition at line 555 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 393 of file Overload.h.
|
inline |
Definition at line 441 of file Overload.h.
|
inline |
Definition at line 445 of file Overload.h.
|
inline |
Definition at line 448 of file Overload.h.
References Ambiguous, Bad, Standard, Uninitialized, and UserDefined.
void ImplicitConversionSequence::DiagnoseAmbiguousConversion | ( | Sema & | S, |
SourceLocation | CaretLoc, | ||
const PartialDiagnostic & | PDiag | ||
) | const |
Diagnoses an ambiguous conversion.
The partial diagnostic is the "lead" diagnostic; it will be given two arguments, the source and target types of the conversion.
Definition at line 9434 of file SemaOverload.cpp.
void ImplicitConversionSequence::dump | ( | ) | const |
dump - Print this implicit conversion sequence to standard error.
Useful for debugging overloading issues.
Definition at line 521 of file SemaOverload.cpp.
|
inline |
Definition at line 469 of file Overload.h.
Referenced by CheckConvertedConstantExpression(), CompareImplicitConversionSequences(), DiagnoseNarrowingInInitList(), and TryContextuallyConvertToObjCPointer().
|
inline |
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 481 of file Overload.h.
References getKind().
Referenced by CompareImplicitConversionSequences().
|
inline |
Definition at line 503 of file Overload.h.
References getKind().
|
inline |
Definition at line 500 of file Overload.h.
References getKind().
Referenced by CompareImplicitConversionSequences(), clang::Sema::PerformContextuallyConvertToBool(), TryCopyInitialization(), TryListConversion(), and TryReferenceInitializationCore().
|
inline |
Definition at line 502 of file Overload.h.
References getKind().
|
inline |
Definition at line 505 of file Overload.h.
Referenced by clang::Sema::CheckSingleAssignmentConstraints().
|
inline |
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 510 of file Overload.h.
References Uninitialized.
|
inline |
Definition at line 501 of file Overload.h.
References getKind().
Referenced by CompareImplicitConversionSequences(), and hasDeprecatedStringLiteralToCharPtrConversion().
|
inline |
Whether the target is really a std::initializer_list, and the sequence only represents the worst element conversion.
Definition at line 544 of file Overload.h.
Referenced by CompareImplicitConversionSequences().
|
inline |
Definition at line 504 of file Overload.h.
References getKind().
Referenced by CompareImplicitConversionSequences(), and hasDeprecatedStringLiteralToCharPtrConversion().
|
inline |
Definition at line 463 of file Overload.h.
|
inline |
Definition at line 529 of file Overload.h.
Referenced by TryUserDefinedConversion().
|
inline |
Definition at line 535 of file Overload.h.
|
inline |
Sets this sequence as a bad conversion for an explicit argument.
Definition at line 513 of file Overload.h.
Referenced by TryImplicitConversion(), TryListConversion(), TryObjectArgumentInitialization(), TryReferenceInit(), and TryUserDefinedConversion().
|
inline |
Sets this sequence as a bad conversion for an implicit argument.
Definition at line 520 of file Overload.h.
|
inline |
Definition at line 527 of file Overload.h.
|
inline |
Definition at line 526 of file Overload.h.
Referenced by TryImplicitConversion(), TryListConversion(), tryObjCWritebackConversion(), TryObjectArgumentInitialization(), and TryUserDefinedConversion().
Definition at line 548 of file Overload.h.
Referenced by TryListConversion().
|
inline |
Definition at line 528 of file Overload.h.
Referenced by TryListConversion(), and TryUserDefinedConversion().
union { ... } |
AmbiguousConversionSequence clang::ImplicitConversionSequence::Ambiguous |
When ConversionKind == AmbiguousConversion, provides the details of the ambiguous conversion.
Definition at line 434 of file Overload.h.
Referenced by ImplicitConversionSequence(), and TryUserDefinedConversion().
BadConversionSequence clang::ImplicitConversionSequence::Bad |
When ConversionKind == BadConversion, provides the details of the bad conversion.
Definition at line 438 of file Overload.h.
Referenced by ImplicitConversionSequence().
StandardConversionSequence clang::ImplicitConversionSequence::Standard |
When ConversionKind == StandardConversion, provides the details of the standard conversion sequence.
Definition at line 426 of file Overload.h.
Referenced by CheckConvertedConstantExpression(), CompareImplicitConversionSequences(), DiagnoseNarrowingInInitList(), hasDeprecatedStringLiteralToCharPtrConversion(), ImplicitConversionSequence(), TryContextuallyConvertToObjCPointer(), TryImplicitConversion(), TryListConversion(), tryObjCWritebackConversion(), TryObjectArgumentInitialization(), and TryUserDefinedConversion().
UserDefinedConversionSequence clang::ImplicitConversionSequence::UserDefined |
When ConversionKind == UserDefinedConversion, provides the details of the user-defined conversion sequence.
Definition at line 430 of file Overload.h.
Referenced by CheckConvertedConstantExpression(), CompareImplicitConversionSequences(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), DiagnoseNarrowingInInitList(), hasDeprecatedStringLiteralToCharPtrConversion(), ImplicitConversionSequence(), TryContextuallyConvertToObjCPointer(), TryListConversion(), and TryUserDefinedConversion().