[all-commits] [llvm/llvm-project] 9fcca8: Fix consteval crash when transforming 'this' expre...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Wed Oct 27 08:25:22 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fcca8b470fb92466ec4cada9fbeacc90096116d
      https://github.com/llvm/llvm-project/commit/9fcca8b470fb92466ec4cada9fbeacc90096116d
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2021-10-27 (Wed, 27 Oct 2021)

  Changed paths:
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/SemaCXX/cxx2a-consteval.cpp

  Log Message:
  -----------
  Fix consteval crash when transforming 'this' expressions

When reaching the end of a function body, we need to ensure that the
ExitFunctionBodyRAII object is destroyed before we pop the declaration context
for the function. Exiting the function body causes us to handle immediate
invocations, which involves template transformations that need to know the
correct type for this.

This addresses PR48235.




More information about the All-commits mailing list