This is an archive of the discontinued LLVM Phabricator instance.

[clang][AST] Propagate the value-dependent bit for VAArgExpr.
ClosedPublic

Authored by hokein on May 19 2023, 3:21 AM.

Details

Summary

Fixes https://github.com/llvm/llvm-project/issues/62711

We never set the value-dependent bit for the VAArgExpr before this
patch, this was fine becase the dependent-type TypoExpr was always
resolved before checking the operands (see https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaExpr.cpp#L21173-L21180)

Now we have enabled the dependence by default for C, the typo expr is
not early resolved before checking rather than delayed (share the same
codepath with C++).

The fix is to propagate the value-dependent bit for VAArgExpr where it contains
a TypoExpr, so that the AST node can be handled properly.

Diff Detail

Event Timeline

hokein created this revision.May 19 2023, 3:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 3:21 AM
hokein requested review of this revision.May 19 2023, 3:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 3:21 AM
aaron.ballman accepted this revision.May 19 2023, 8:32 AM
aaron.ballman added a subscriber: aaron.ballman.

LGTM assuming CI is okay with it -- the patch did not apply so precommit CI never ran. I'm surprised no tests break as a result of this because it changes both C and C++ behavior. The changes should have a release note, too.

This revision is now accepted and ready to land.May 19 2023, 8:32 AM
hokein updated this revision to Diff 523875.May 19 2023, 11:32 AM

add release note

Thanks for the review.

LGTM assuming CI is okay with it -- the patch did not apply so precommit CI never ran. I'm surprised no tests break as a result of this because it changes both C and C++ behavior. The changes should have a release note, too.

This patch was based on my another fix (this probably explains why it failed to apply on pre-merge testing CI). I have test it with ninja check-clang.

This revision was landed with ongoing or failed builds.May 19 2023, 2:43 PM
This revision was automatically updated to reflect the committed changes.