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

Alan Zhao via All-commits all-commits at lists.llvm.org
Thu Apr 27 10:43:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7417e9d75c9af7dd0d3dad12eebdee84b10b56d7
      https://github.com/llvm/llvm-project/commit/7417e9d75c9af7dd0d3dad12eebdee84b10b56d7
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2023-04-27 (Thu, 27 Apr 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