[all-commits] [llvm/llvm-project] 5548ea: [Clang] Instantiate local constexpr functions eage...

Younan Zhang via All-commits all-commits at lists.llvm.org
Sun Jun 16 06:54:40 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5548ea34341e9d0ae645719c34b466ca3b9eaa5a
      https://github.com/llvm/llvm-project/commit/5548ea34341e9d0ae645719c34b466ca3b9eaa5a
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-06-16 (Sun, 16 Jun 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaTemplate/instantiate-local-class.cpp

  Log Message:
  -----------
  [Clang] Instantiate local constexpr functions eagerly (#95660)

We had a code path in `Sema::MarkFunctionReferenced()` that deferred
local lambda instantiation even for constexprs. This resulted in any
calls to them referring to function decls that lack bodies and hence
failures at constant evaluation.

The issue doesn't occur when the lambda has no explicit return type
because the return type deduction requires instantiation.

Fixes https://github.com/llvm/llvm-project/issues/35052
Fixes https://github.com/llvm/llvm-project/issues/94849



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