[PATCH] D129531: [clang][C++20] P0960R3: Allow initializing aggregates from a parenthesized list of values

Alan Zhao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 16:59:02 PDT 2022


ayzhao added a comment.

Friendly ping for reviewers since (I think) this is more or less complete.

Additionally, I found out that the GCC implementation [0] allows references to aggregates to be paren-initialized - i.e. it accepts the following:

  struct A {
    int a;
    int b;
  };
  const A& r(1, 2);
  int (&&rr)[](1, 2, 3);

however; I don't see anything in the standard that supports these kinds of expressions. Moreover, MSVC also doesn't support paren-initialized aggregate references [1].

Could someone familiar with the standard comment on this?

[0]: https://github.com/gcc-mirror/gcc/commit/43aae289866f5ea55d187444520412554aa2e171
[1]: https://godbolt.org/z/87cdn6c19


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129531



More information about the cfe-commits mailing list