This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Fix __VA_OPT__ implementation so that it treats the concatenation of a non-placemaker token and placemaker token as a non-placemaker token
ClosedPublic

Authored by shafik on Jan 25 2023, 10:32 PM.

Details

Summary

Currently the implementation of __VA_OPT__ will treat the concatenation of a non-placemaker token and placemaker token as a placemaker token which is not correct. This will fix the implementation and treat the result as a non-placemaker token.

This fixes: https://github.com/llvm/llvm-project/issues/60268

Diff Detail

Event Timeline

shafik created this revision.Jan 25 2023, 10:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2023, 10:32 PM
shafik requested review of this revision.Jan 25 2023, 10:32 PM
shafik updated this revision to Diff 492560.Jan 26 2023, 1:55 PM
  • Update line ending in test
shafik updated this revision to Diff 492562.Jan 26 2023, 2:07 PM
  • I think I correctly updated line endings this time
shafik added inline comments.Jan 26 2023, 2:14 PM
clang/test/Preprocessor/macro_vaopt_p1042r1.cpp
1

I removed Windows lines ending from this test, I don't think they matter but if someone can see why they would let me know.

shafik updated this revision to Diff 492589.Jan 26 2023, 3:56 PM
  • Apply clang-format

It looks like the modules test failures are unrelated and are failing all the recent modules builds.

Pretty sure @cor3ntin and @tahonermann are our Lexer code owners? Or at least were in the initial proposal.

rsmith accepted this revision.Feb 14 2023, 11:35 AM
This revision is now accepted and ready to land.Feb 14 2023, 11:35 AM
aaron.ballman accepted this revision.Feb 14 2023, 11:59 AM

LGTM but please add a release note for the fix.

I don't think the libc++ precommit CI failures are related to this change and so I don't think they block anything, but it'd be nice if a libc++ person could verify (CC @ldionne @Mordante )

I suspect the libc++ failure is because the patch is not rebased onto main. I remember seeing those issues a while back. I think it's unlikely to be this patch.

shafik updated this revision to Diff 498510.Feb 17 2023, 2:48 PM
  • Add release note
This revision was landed with ongoing or failed builds.Feb 17 2023, 2:58 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 2:58 PM