diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-29 17:31:54 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-29 17:31:54 +0000 |
commit | 4a6a2b80c1771a2688a6349f8302263a3ebf4659 (patch) | |
tree | f0f0eb458e7cab8ccdcaf38f5f0cf07497ed83ba | |
parent | 6af01047a3c2f8e286f0e2868c5463a88c5ae632 (diff) |
Fixes a nasty bug which only turned up in 32bit build of clang and
had to do with an initialized field when multiple type conversions
are ambiguous but must be treated as user defined conversion for
overload resolution purposes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83079 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 1283ff4b5e..9e76617722 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -2241,9 +2241,15 @@ Sema::AddOverloadCandidate(FunctionDecl *Function, // ranking implicit conversion sequences as described in 13.3.3.2, the ambiguous // conversion sequence is treated as a user-defined sequence that is // indistinguishable from any other user-defined conversion sequence - if (!Candidate.Conversions[ArgIdx].ConversionFunctionSet.empty()) + if (!Candidate.Conversions[ArgIdx].ConversionFunctionSet.empty()) { Candidate.Conversions[ArgIdx].ConversionKind = ImplicitConversionSequence::UserDefinedConversion; + // Set the conversion function to one of them. As due to ambiguity, + // they carry the same weight and is needed for overload resolution + // later. + Candidate.Conversions[ArgIdx].UserDefined.ConversionFunction = + Candidate.Conversions[ArgIdx].ConversionFunctionSet[0]; + } else { Candidate.Viable = false; break; |