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

Guillot Tony via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 20 22:34:56 PDT 2022


to268 added a comment.

Also i have found that we don't parse the compound literal with the `auto` keyword correctly in `ParseExpr.cpp` between line 939 to 973 which is the beginning of `Parser::ParseCastExpression(...)`

  int test_cl = (int){12};      // Compound literal is detected
  auto test_cl2 = (auto){12};   // Compound literal is not detected

I've haven't dig deeper yet but maybe it's because we are not including `auto` when trying to guess if it's a compound literal due to the fact that `auto` is a `storage-class-specifier`



================
Comment at: clang/test/Sema/c2x-auto.c:49
+    auto b = 9;
+    auto c = a + b;
+  }
----------------
shafik wrote:
> When I made the comment about the example from the proposal, this was what I was thinking about.
Do i need to treat shadowing when using `auto` as invalid?


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