This is an archive of the discontinued LLVM Phabricator instance.

[clang] Replace Member Expressions During Instantiation If Necessary
ClosedPublic

Authored by lime on Mar 7 2023, 5:24 AM.

Details

Summary

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.

Diff Detail

Event Timeline

lime requested review of this revision.Mar 7 2023, 5:24 AM
lime created this revision.
lime edited the summary of this revision. (Show Details)Mar 7 2023, 5:27 AM

Other than the two auto's missing a *, I think this is alright. I want to think about it/give others a chance to review, so please ping this in a few days if it hasn't been accepted by then.

clang/lib/Sema/TreeTransform.h
2808
2812
lime updated this revision to Diff 504535.Mar 13 2023, 1:13 AM

Update and ping.

erichkeane accepted this revision.Mar 13 2023, 7:07 AM

Thanks for the ping. I don't have any better ideas/other thoughts, so LGTM.

This revision is now accepted and ready to land.Mar 13 2023, 7:07 AM