[all-commits] [llvm/llvm-project] ca844a: Fix template instantiation of UDLs

Aaron Ballman via All-commits all-commits at lists.llvm.org
Mon Mar 28 11:47:09 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca844ab01c3f9410ceca967c09f809400950beae
      https://github.com/llvm/llvm-project/commit/ca844ab01c3f9410ceca967c09f809400950beae
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2022-03-28 (Mon, 28 Mar 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/TreeTransform.h
    M clang/test/CodeGenCXX/cxx20-consteval-crash.cpp
    M clang/test/SemaCXX/cxx2a-consteval.cpp

  Log Message:
  -----------
  Fix template instantiation of UDLs

Previously, we would instantiate the UDL by marking the function as
referenced and potentially binding to a temporary; this skipped
transforming the call when the UDL was dependent on a template
parameter.

Now, we defer all the work to instantiating the call expression for the
UDL. This ensures that constant evaluation occurs at compile time
rather than deferring until runtime.

Fixes Issue 54578.




More information about the All-commits mailing list