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

Guillot Tony via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 5 04:30:24 PDT 2022


to268 created this revision.
to268 added reviewers: aaron.ballman, clang-language-wg, jyknight.
Herald added a project: All.
to268 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patches implements the `auto` keyword from the N3007 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3007.htm> standard specification.
This allows deducing the type of the variable like in C++

  auto nb = 1;
  auto chr = 'A';
  auto str = "String";


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133289

Files:
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Sema/DeclSpec.cpp
  clang/test/C/C2X/n3007.c
  clang/test/CodeGen/auto.c
  clang/test/Parser/c2x-auto.c
  clang/test/Sema/c2x-auto.c
  clang/www/c_status.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133289.457930.patch
Type: text/x-patch
Size: 10974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220905/067741f8/attachment-0001.bin>


More information about the cfe-commits mailing list