[PATCH] D111283: [clang] template / auto deduction deduces common sugar

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 12 16:02:49 PDT 2021


mizvekov marked 3 inline comments as done.
mizvekov added inline comments.


================
Comment at: clang/test/SemaCXX/sugared-auto.cpp:146
+    return a;
+  return N(); // expected-error {{but deduced as 'SARS (*)() throw(Man, Vibrio)' (aka 'void (*)() throw(Man, Vibrio)')}}
+}
----------------
mizvekov wrote:
> rsmith wrote:
> > rsmith wrote:
> > > Why don't we get `Virus` as the deduced return type from line 143 here?
> > Oh, never mind, we've not updated the conditional expression handling to use `getCommonSugar` yet. We probably should -- it currently has a very minimal form of the same thing; see `Sema::FindCompositePointerType`. That can presumably be changed to use `getCommonSugar` once it strips down to a common type. On around `SemaExprCXX.cpp:6870`:
> > ```
> > -  QualType Composite = Composite1;
> > +  QualType Composite = Context.getCommonSugar(Composite1, Composite2);
> > ```
> Yeah, if you look into the next patch in the stack, which is still WIP, there is a change that fixes this aspect of this test case, but it's a different change than what you are proposing here. I will take a look again, but are you proposing that I add this sort of changes to this same patch, or keep things separate as I am trying to do?
> Either answer is fine, less patches means less rebuild time for me :-)
This is done in https://reviews.llvm.org/D111509


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111283



More information about the cfe-commits mailing list