[clang] [Clang] Ensure the method scope at the late parsing of noexcept specifiers (PR #98023)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 04:21:14 PDT 2024


zyn0217 wrote:

So the previous problem was that we ended up exercising `IsInFnTryBlockHandler()` on constructors with `noexcept` specifiers. That function assumes that if we're in a function `DeclContext` (which is brought by `SynthesizedFunctionScope`, which also pushes a `DeclContext`), we would also have had a function `Scope` pushed. So, a solution is to pull in a `Scope` as well.

Regarding the conformance of `[expr.prim.id.general]p4`, I think overriding the `ThisType` is a bit suboptimal. While it affects `ClassifyImplicitMemberAccess()` so that we don't need an implicit `this` in such situations, I think a probably more optimal way is to fix the algorithm in `ClassifyImplicitMemberAccess()` to consider unevaluated contexts - that could presumably resolve all conforming cases in `clang/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp`. So, I reverted these changes at the moment.


https://github.com/llvm/llvm-project/pull/98023


More information about the cfe-commits mailing list