This is an archive of the discontinued LLVM Phabricator instance.

Add a c2x language mode
AbandonedPublic

Authored by aaron.ballman on Aug 12 2016, 9:43 AM.

Details

Summary

This patch adds support for a "c2x" language standard mode for the eventual new C language standard, expected to come out in 202x. The spelling and capitalization is pulled from the C2x charter (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2021.htm).

I added a pretty simple driver test for this language mode because we do not currently have any C2x language features. However, I have a WIP patch that will require this functionality and figured that this part should be split off from it. If there is a better way to test this, or if it should wait for the WIP, please let me know.

Diff Detail

Event Timeline

aaron.ballman retitled this revision from to Add a c2x language mode.
aaron.ballman updated this object.
aaron.ballman added reviewers: rsmith, doug.gregor.
aaron.ballman added a subscriber: cfe-commits.
majnemer added inline comments.
include/clang/Frontend/LangStandards.def
94

Should this be C2x instead of C2X?

aaron.ballman marked an inline comment as done.Aug 12 2016, 10:25 AM
aaron.ballman added inline comments.
include/clang/Frontend/LangStandards.def
94

Probably. :-D

rsmith edited edge metadata.Aug 15 2016, 3:01 PM

This seems premature; according to the charter, we are more than three years away from the C2x committee draft phase. Perhaps we should wait until we have either a new working draft or a paper approved by the WG14 for such a working draft.

aaron.ballman marked an inline comment as done.Aug 15 2016, 3:07 PM

This seems premature; according to the charter, we are more than three years away from the C2x committee draft phase. Perhaps we should wait until we have either a new working draft or a paper approved by the WG14 for such a working draft.

The problem is: I think I need the flag for working on some features that are being proposed, as WG14 does not typically accept novel language features. Specifically, I am planning work on N2049, adding attributes to C. This work will be done under a separate flag anyway (since it's obviously not approved and in the working draft), but I would like the feature to only be enabled for C2x and not C11 or earlier (at least initially) so that I don't have to worry about someone turning on the feature flag for C11 and running into a situation later where we don't want the feature supported in C11 (not that I have such a situation in mind currently). This is not entirely unlike how we don't support C++-style attributes in C++03 mode.

aaron.ballman abandoned this revision.Sep 4 2017, 6:21 AM