[all-commits] [llvm/llvm-project] a4f859: [clang] Allow consteval functions in default argum...

Evgeny Shulgin via All-commits all-commits at lists.llvm.org
Mon Jun 6 19:56:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a4f8590247264b9c3121f48dd5b3db707c934ba2
      https://github.com/llvm/llvm-project/commit/a4f8590247264b9c3121f48dd5b3db707c934ba2
  Author: Evgeny Shulgin <izaronplatz at gmail.com>
  Date:   2022-06-07 (Tue, 07 Jun 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/Decl.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaCXX/cxx2a-consteval.cpp

  Log Message:
  -----------
  [clang] Allow consteval functions in default arguments

We should not mark a function as "referenced" if we call it within a
ConstantExpr, because the expression will be folded to a value in LLVM
IR. To prevent emitting consteval function declarations, we should not "jump
over" a ConstantExpr when it is a top-level ParmVarDecl's subexpression.

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

Reviewed By: erichkeane, aaron.ballman, ChuanqiXu

Differenitial Revision: https://reviews.llvm.org/D119646




More information about the All-commits mailing list