[PATCH] D102168: Use an allow list on reserved macro identifiers

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 10 08:18:02 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/lib/Lex/PPDirectives.cpp:125
+  if (II->isReserved(Lang) != ReservedIdentifierStatus::NotReserved) {
+    static constexpr std::array<StringRef, 16> ReservedMacro = {
+        "_ATFILE_SOURCE",       "_BSD_SOURCE",    "_FILE_OFFSET_BITS",
----------------
aaron.ballman wrote:
> 
Can you add a comment that this list is required to remain in alphabetical order (due to the use of `binary_search`) and list the identifiers in long-form rather than columns of three (this makes it easier for folks inserting new elements into the list)?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102168/new/

https://reviews.llvm.org/D102168



More information about the cfe-commits mailing list