[all-commits] [llvm/llvm-project] 1e7efc: [clang] fix crash when template with constructor a...

Carson Radtke via All-commits all-commits at lists.llvm.org
Thu Nov 27 23:27:05 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e7efca659cdf37a95e27e35fa002d340ea68b32
      https://github.com/llvm/llvm-project/commit/1e7efca659cdf37a95e27e35fa002d340ea68b32
  Author: Carson Radtke <nosrac925 at gmail.com>
  Date:   2025-11-28 (Fri, 28 Nov 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/SemaTemplate/attributes.cpp

  Log Message:
  -----------
  [clang] fix crash when template with constructor attribute is instantiated without a priority (#169282)

fixes: https://github.com/llvm/llvm-project/issues/169072

The current implementation expects the priority argument to be provided
to `[[gnu::constructor(<priority>)]]`, but the argument is really
optional. This was causing a segfault when instantiating the
function-template because we were trying to fold an `Expr*` that was a
nullptr.

This change skips the evaluation of the priority argument when it is
missing; this will instantiate a function declaration with the default
priority (65535).



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