[all-commits] [llvm/llvm-project] 8cf285: [pseudo] Allow mixed designated/undesignated init ...

Sam McCall via All-commits all-commits at lists.llvm.org
Tue Jun 28 06:46:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8cf28585a40311163a08840beee035097638d41d
      https://github.com/llvm/llvm-project/commit/8cf28585a40311163a08840beee035097638d41d
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-06-28 (Tue, 28 Jun 2022)

  Changed paths:
    M clang-tools-extra/pseudo/lib/cxx.bnf
    A clang-tools-extra/pseudo/test/cxx/mixed-designator.cpp

  Log Message:
  -----------
  [pseudo] Allow mixed designated/undesignated init lists.

This isn't allowed by the standard grammar but is allowed in C, and clang/GCC
permit it as an extension.
It avoids the need to determine which type of list we have in error-recovery.

While here, also support array index designators `{ [4]=1 }` which are
also legal in C, and common extensions in C++.

Differential Revision: https://reviews.llvm.org/D128687




More information about the All-commits mailing list