This is an archive of the discontinued LLVM Phabricator instance.

[C2x] Add test coverage for WG14 N2322
ClosedPublic

Authored by aaron.ballman on Oct 28 2022, 5:00 AM.

Details

Reviewers
erichkeane
jyknight
Group Reviewers
Restricted Project
Summary

The changes in this paper add a new recommended practice. I had originally marked Clang as supporting this paper because we're not obligated to follow a recommended practice. However, in retrospect, it seems more useful to document whether we implement the recommendation or not. This adds a test for those changes. However, the recommended practice is just tricky enough to test, I wanted a second set of eyes on my test coverage to see if there's agreement I'm testing the right things and have come to the right conclusion.

Diff Detail

Event Timeline

aaron.ballman created this revision.Oct 28 2022, 5:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 5:00 AM
aaron.ballman requested review of this revision.Oct 28 2022, 5:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 5:00 AM

I had two suggestions for more tests, but this is probably covering everything.

clang/test/C/C2x/n2322.c
44

I might suggest:

_Static_assert(555 == \
LI\
NE\
)

Which, is basically exactly what the first bullet point in J.1 is trying to figure out (it should be the opening character).

I think this is a repeat of the string-literal test, but it is basically exactly what they were talking about with PP-token.

Not a great addition to this file perhaps, but something with #warning might be a nice exercise of the pp-directive, to make sure it hits the diagnostics engine right?

aaron.ballman marked an inline comment as done.

Added an additional test case.

clang/test/C/C2x/n2322.c
44

I've added the test.

erichkeane accepted this revision.Oct 28 2022, 8:00 AM

I'm OK with this either way, I think you've proved out the important cases.

This revision is now accepted and ready to land.Oct 28 2022, 8:00 AM
jyknight accepted this revision.Oct 28 2022, 9:09 AM
aaron.ballman closed this revision.Oct 28 2022, 9:47 AM

Committed in f1c9ef311fa677992798d609b0445f1d7311a8f2 (forgot to link the review with the commit message, sorry), thank you for the reviews!