[all-commits] [llvm/llvm-project] 1cf518: [clang] Fix crash when passing a braced-init list ...

Alan Zhao via All-commits all-commits at lists.llvm.org
Wed May 31 13:53:00 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1cf5188c72902e85e85095d788f5dfa138c320f8
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2023-05-31 (Wed, 31 May 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaInit.cpp
    M clang/test/SemaCXX/paren-list-agg-init.cpp

  Log Message:
  [clang] Fix crash when passing a braced-init list to a parentehsized aggregate init expression

The previous code incorrectly assumed that we would never call
warnBracedScalarInit(...) with a EK_ParenAggInitMember. This patch fixes
the bug by warning when a scalar member is initialized via a braced-init
list when performing a parentehsized aggregate initialization. This
behavior is consistent with parentehsized list aggregate initialization.

Fixes #63008

Reviewed By: shafik

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

More information about the All-commits mailing list