diff options
| author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-09-24 17:48:32 +0000 | 
|---|---|---|
| committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-09-24 17:48:32 +0000 | 
| commit | a72462cdf43be94369d190a9de807433bf426a27 (patch) | |
| tree | 3e681f08aeb508bb6cd06c8b4fd490397825d65d /clang/lib/Sema | |
| parent | a74948d347913c284009e0fca41b120980db3fa4 (diff) | |
| download | bcm5719-llvm-a72462cdf43be94369d190a9de807433bf426a27.tar.gz bcm5719-llvm-a72462cdf43be94369d190a9de807433bf426a27.zip  | |
Add a special note for overload resolution when an initializer list argument
cannot be converted.
This is in preparation for overload resolution of initializer lists.
Currently, you will always get this message when you try to pass an init
list to an overloaded function.
llvm-svn: 140461
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 513990e177f..c2bf9d3848f 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -6915,6 +6915,17 @@ void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, unsigned I) {      return;    } +  // Special diagnostic for failure to convert an initializer list, since +  // telling the user that it has type void is not useful. +  if (FromExpr && isa<InitListExpr>(FromExpr)) { +    S.Diag(Fn->getLocation(), diag::note_ovl_candidate_bad_list_argument) +      << (unsigned) FnKind << FnDesc +      << (FromExpr ? FromExpr->getSourceRange() : SourceRange()) +      << FromTy << ToTy << (unsigned) isObjectArgument << I+1; +    MaybeEmitInheritedConstructorNote(S, Fn); +    return; +  } +    // Diagnose references or pointers to incomplete types differently,    // since it's far from impossible that the incompleteness triggered    // the failure.  | 

