[all-commits] [llvm/llvm-project] 33b41a: [clang] Fix a crash with parenthesized aggregate i...

Alan Zhao via All-commits all-commits at lists.llvm.org
Mon May 1 21:16:51 PDT 2023

  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 33b41a6564f94e51d918cdabf44e92a60e596325
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2023-05-01 (Mon, 01 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 a crash with parenthesized aggregate initialization and base classes

When calling InitializeBase(...), TryOrBuidlParenListInit(...) needs to
pass in the parent entity; otherwise, we erroneously try to cast
CurContext to a CXXConstructorDecl[0], which can't be done since we're
performing aggregate initialization, not constructor initialization.

Field initialization is not affected, but this patch still adds some
tests for it.

Fixes 62296

[0]: https://github.com/llvm/llvm-project/blob/33d6bd1c667456f7f4a9d338a7996a30a3af50a3/clang/lib/Sema/SemaAccess.cpp#L1696

Reviewed By: aaron.ballman

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

More information about the All-commits mailing list