[PATCH] D111814: Fix consteval crash when transforming 'this' expressions
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 14 08:46:05 PDT 2021
aaron.ballman created this revision.
aaron.ballman added reviewers: rsmith, rjmccall, erichkeane.
aaron.ballman requested review of this revision.
Herald added a project: clang.
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.
(Note, the diff in Phrabricator looks more awful than it is in reality -- the only change to the code was to add a new compound scope, but indenting the contents of that new scope seems to make for confusing-looking diffs.)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D111814
Files:
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaCXX/cxx2a-consteval.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111814.379734.patch
Type: text/x-patch
Size: 30967 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211014/a2ebb3b2/attachment-0001.bin>
More information about the cfe-commits
mailing list