[PATCH] D61370: Add a C2x mode and allow attributes in it

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 03:08:23 PDT 2019


aaron.ballman created this revision.
aaron.ballman added reviewers: rsmith, dblaikie.

WG14 has a working draft for C2x (WG14 N2346) and we've begun voting new features into it, so I think it's time for use to expose a C2x flag and use it. The new features we adopted this week that Clang already has support for are: the new attribute syntax (WG14 N2335), the `[[nodiscard]]` attribute (WG14 N2267), the `[[maybe_unused]]` attribute (WG14 N2270), and the `[[deprecated]]` attribute (WG14 N2334).

This patch adds the new C2x language mode and flips a switch to allow double-square bracket attributes in that new mode.


https://reviews.llvm.org/D61370

Files:
  include/clang/Basic/LangOptions.def
  include/clang/Frontend/LangStandard.h
  include/clang/Frontend/LangStandards.def
  lib/Frontend/CompilerInvocation.cpp
  test/Driver/unknown-std.c
  test/Parser/c2x-attributes.c
  test/Sema/attr-cx2.c
  test/Sema/attr-deprecated-c2x.c
  test/Sema/c2x-maybe_unused-errors.c
  test/Sema/c2x-maybe_unused.c
  test/Sema/c2x-nodiscard.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61370.197515.patch
Type: text/x-patch
Size: 6988 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190501/560d09a5/attachment-0001.bin>


More information about the cfe-commits mailing list