[clang] Replace Member Expressions During Instantiation If Necessary
authorLiming Liu <gangliugangliu.ml@outlook.com>
Tue, 7 Mar 2023 13:08:57 +0000 (21:08 +0800)
committerLiming Liu <gangliugangliu.ml@outlook.com>
Mon, 13 Mar 2023 14:22:06 +0000 (22:22 +0800)
commit3951c28b37ff67c87da59df961c4af19818c24c2
treeb819df4adfd8bf45e4d6e68a1c6c785c81dfc885
parent4d55a0b512a17dfaa2461b8803d37b79f6c9691d
[clang] Replace Member Expressions During Instantiation If Necessary

This patch replaces member accesses to declaration references during template
instantiation if the context is the unevaluated context and the class does not
contain the declaration.

The replacement fixes the issue #58674. Unlike previous fixes such as D143840,
it checks the membership during instantiation rather than right after parsing,
so the check is more accurate and efficient.

This patch also includes cases that previous fixes had once failed on.

Differential Revision: https://reviews.llvm.org/D145491
clang/docs/ReleaseNotes.rst
clang/lib/Sema/TreeTransform.h
clang/test/CodeGenCXX/decl-ref-inheritance.cpp [new file with mode: 0644]
clang/test/SemaCXX/decltype.cpp