diff options
author | Guillot Tony <tony.guillot@protonmail.com> | 2023-10-05 12:14:23 -0400 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2023-10-05 12:16:00 -0400 |
commit | 13ffc61a4224012ab1abb4e806d03fc149aec91f (patch) | |
tree | 28dc578270084a7472045534a1ac22818bdda197 /llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | |
parent | 0ca7e609fc5ebdd9c95f6cba3c608cae4b575846 (diff) | |
download | llvm-13ffc61a4224012ab1abb4e806d03fc149aec91f.zip llvm-13ffc61a4224012ab1abb4e806d03fc149aec91f.tar.gz llvm-13ffc61a4224012ab1abb4e806d03fc149aec91f.tar.bz2 |
[C2X] N3007 Type inference for object definitions
Re-landing 5d78b78c8538 which was reverted.
This patches implements the auto keyword from the N3007 standard
specification.
This allows deducing the type of the variable like in C++:
```
auto nb = 1;
auto chr = 'A';
auto str = "String";
```
The list of statements which allows the usage of auto:
* Basic variables declarations (int, float, double, char, char*...)
* Macros declaring a variable with the auto type
The list of statements which will not work with the auto keyword:
* auto arrays
* sizeof(), alignas()
* auto parameters, auto return type
* auto as a struct/typedef member
* uninitialized auto variables
* auto in an union
* auto as a enum type specifier
* auto casts
* auto in an compound literals
Differential Revision: https://reviews.llvm.org/D133289
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp')
0 files changed, 0 insertions, 0 deletions