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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 11 18:29:37 PDT 2021


rsmith 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)')}}
+}
----------------
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);
```


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