diff options
| author | Douglas Gregor <dgregor@apple.com> | 2008-11-03 19:09:14 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2008-11-03 19:09:14 +0000 |
| commit | 2fe9883a961dfa872b0a20e8b56e7bf65fc98b6f (patch) | |
| tree | 531be31c1fde3c0c9659e1c677968dd8da52dced /clang/lib/Sema/Sema.h | |
| parent | 4d0549e3be84ae5645c1d6f4745c276e5bb69289 (diff) | |
| download | bcm5719-llvm-2fe9883a961dfa872b0a20e8b56e7bf65fc98b6f.tar.gz bcm5719-llvm-2fe9883a961dfa872b0a20e8b56e7bf65fc98b6f.zip | |
Standard conversion sequences now have a CopyConstructor field, to
cope with the case where a user-defined conversion is actually a copy
construction, and therefore can be compared against other standard
conversion sequences. While I called this a hack before, now I'm
convinced that it's the right way to go.
Compare overloads based on derived-to-base conversions that invoke
copy constructors.
Suppress user-defined conversions when attempting to call a
user-defined conversion.
llvm-svn: 58629
Diffstat (limited to 'clang/lib/Sema/Sema.h')
| -rw-r--r-- | clang/lib/Sema/Sema.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index fa87479df7d..1b08a45fe88 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -370,7 +370,9 @@ private: /// C++ Overloading. bool IsOverload(FunctionDecl *New, Decl* OldD, OverloadedFunctionDecl::function_iterator &MatchedDecl); - ImplicitConversionSequence TryImplicitConversion(Expr* From, QualType ToType); + ImplicitConversionSequence + TryImplicitConversion(Expr* From, QualType ToType, + bool SuppressUserConversions = false); bool IsStandardConversion(Expr *From, QualType ToType, StandardConversionSequence& SCS); bool IsIntegralPromotion(Expr *From, QualType FromType, QualType ToType); @@ -398,7 +400,9 @@ private: CompareDerivedToBaseConversions(const StandardConversionSequence& SCS1, const StandardConversionSequence& SCS2); - ImplicitConversionSequence TryCopyInitialization(Expr* From, QualType ToType); + ImplicitConversionSequence + TryCopyInitialization(Expr* From, QualType ToType, + bool SuppressUserConversions = false); bool PerformCopyInitialization(Expr *&From, QualType ToType, const char *Flavor); @@ -412,10 +416,12 @@ private: void AddOverloadCandidate(FunctionDecl *Function, Expr **Args, unsigned NumArgs, - OverloadCandidateSet& CandidateSet); + OverloadCandidateSet& CandidateSet, + bool SuppressUserConversions = false); void AddOverloadCandidates(OverloadedFunctionDecl *Ovl, Expr **Args, unsigned NumArgs, - OverloadCandidateSet& CandidateSet); + OverloadCandidateSet& CandidateSet, + bool SuppressUserConversions = false); bool isBetterOverloadCandidate(const OverloadCandidate& Cand1, const OverloadCandidate& Cand2); OverloadingResult BestViableFunction(OverloadCandidateSet& CandidateSet, @@ -1165,7 +1171,8 @@ private: bool& DerivedToBase); bool CheckReferenceInit(Expr *&simpleInit_or_initList, QualType &declType, - ImplicitConversionSequence *ICS = 0); + ImplicitConversionSequence *ICS = 0, + bool SuppressUserConversions = false); /// CheckCastTypes - Check type constraints for casting between types. bool CheckCastTypes(SourceRange TyRange, QualType CastTy, Expr *&CastExpr); |

