[all-commits] [llvm/llvm-project] 55611d: [clang][Sema]fix crash of invalid friend declarati...

firstmoonlight via All-commits all-commits at lists.llvm.org
Mon Jun 8 06:22:10 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 55611deca57a0843cbfceca50ccbdfa9e1a3bf84
      https://github.com/llvm/llvm-project/commit/55611deca57a0843cbfceca50ccbdfa9e1a3bf84
  Author: firstmoonlight <1023365236 at qq.com>
  Date:   2026-06-08 (Mon, 08 Jun 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Sema/DeclSpec.h
    M clang/lib/Sema/DeclSpec.cpp
    M clang/test/CXX/class/class.friend/p6.cpp

  Log Message:
  -----------
  [clang][Sema]fix crash of invalid friend declaration with storage-class specifier (#190597)

Fix an assertion failure in Sema::ActOnFriendTypeDecl when parsing an
invalid friend type declaration that incorrectly includes a
storage-class specifier (e.g., 'static', 'extern', 'register').

Root cause:
If the type specifier is marked as invalid, DeclSpec::Finish returns
early. However, even when the type specifier is invalid, some other
checks can still be performed instead of skipping everything.

This change allows necessary checks to proceed, preventing the
assertion in ActOnFriendTypeDecl and enabling proper error diagnostics.

Fixes: https://github.com/llvm/llvm-project/issues/186569

Co-authored-by: victorl <liuvicsen at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list