[PATCH] D122885: [clang] Draft: Implement P1703R1

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 1 02:14:35 PDT 2022


tbaeder created this revision.
tbaeder added reviewers: aaron.ballman, iains, urnathan, ChuanqiXu.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

As in: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1703r1.html

Posting this mostly to get some feedback on the general path taken.

>From reading the paper, I understand that the preprocessor should gain a "import-keyword" token, but that is already taken by the GNU `#import` extension.

The implementation here starts converting newlines to `eod` tokens when seeing a `export` or `import` token. However, that means ignoring the `eod` tokens when parsing an export block, an exported declaration or a non-header-unit module import.

Let me know what you think.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122885

Files:
  clang/include/clang/Basic/DiagnosticLexKinds.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/lib/Lex/Preprocessor.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Parse/Parser.cpp
  clang/test/CXX/cpp/cpp.module/p1.cpp
  clang/test/CXX/lex/lex.pptoken/p3-2a.cpp
  clang/test/Modules/P1703R1.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122885.419665.patch
Type: text/x-patch
Size: 12709 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220401/6c26a416/attachment-0001.bin>


More information about the cfe-commits mailing list