[PATCH] D133289: [C2X] N3007 Type inference for object definitions

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 7 00:55:45 PDT 2022


cor3ntin added a comment.

In D133289#3773708 <https://reviews.llvm.org/D133289#3773708>, @to268 wrote:

> Also @aaron.ballman said me that he was thinking about maybe adding an extension to add support for `auto` in a function return or in a parameter list.

I think extensions are best left to a separate pr, if at all.
Supporting deduced return type sounds fine, with a warning.
Supporting auto template parameters... Not so much, as it would in effect bring function templates, overloading and mangling into C... I don't think we want to go there.

I think we should consider supporting auto in older language modes though.

Or at least, improving the diagnostics for auto in older language modes.

> type specifier missing, defaults to 'int'.

The probability that someone tries to use auto as a storage specifier and want an implicit int at the same time is about 0.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133289



More information about the cfe-commits mailing list