[PATCH] D74238: [clang] Improve diagnostic note for implicit conversion sequences that would work if more than one implicit user-defined conversion were allowed.

2020-05-05 Thread Logan Smith via Phabricator via cfe-commits
logan-5 abandoned this revision.
logan-5 added a comment.

@rsmith the intention is to only speculatively search one level deep (e.g. 
search for chains like A->B, B->C, but no deeper), which should cover most of 
the cases that are surprising to users.

However, the implementation of this patch has some issues, and it doesn't work 
quite how I intended. I still like the idea and I'd like to revisit it, but 
pondering how to get it to work properly is more than I have time for at the 
moment, with all the craziness in the world. So in the meantime, I'd like to 
withdraw it--I'll mark it and its related patches as 'abandoned'. Thanks very 
much for your time considering it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74238/new/

https://reviews.llvm.org/D74238



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74238: [clang] Improve diagnostic note for implicit conversion sequences that would work if more than one implicit user-defined conversion were allowed.

2020-03-16 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment.

How do you defend against attempting an infinite sequence of user-defined 
conversion? For example:

  template struct X {
  operator X();
  };
  X<0> x0 = X<1>();




Comment at: clang/lib/Sema/SemaOverload.cpp:7333
+// Save the bad conversion in the candidate, for later use by diagnostics.
+Candidate.Conversions[0].setBad(BadConversionSequence::no_conversion,
+From, CallResultType);

`Conversions[0]` is for the conversion of the object argument to the implicit 
object parameter. This should be stored in `Candidate.FinalConversion` instead.



Comment at: clang/lib/Sema/SemaOverload.cpp:11349
+  if (Cand->FailureKind == ovl_fail_bad_final_conversion
+  && Cand->Conversions[0].isBad()) {
+SetAsMultipleUserDefined(Cand->Conversions[0]);

`&&` goes on the previous line (here and below).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74238/new/

https://reviews.llvm.org/D74238



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74238: [clang] Improve diagnostic note for implicit conversion sequences that would work if more than one implicit user-defined conversion were allowed.

2020-03-04 Thread Logan Smith via Phabricator via cfe-commits
logan-5 added a comment.

Pinging this and the patches it depends on. I figured it would need a rebase by 
now, but it still applies cleanly to trunk.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74238/new/

https://reviews.llvm.org/D74238



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits