[PATCH] D128981: [C++20][Modules] Implement include translation.

Iain Sandoe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 2 01:13:05 PDT 2022


iains updated this revision to Diff 441871.
iains added a comment.

fix a state transition after include translation.

This update fixes an (apparently pre-existing) bug in handling:

  module;
   #include "translated-header.h"
   import "header-unit.h";

The translation process pushes a tok::annot_module_include which was being
handled as "misc" in the state machine, leading to the wrong starting state
for processing the 'import' following.  The change here treats this token
as if it were the ';' that is notionally injected as part of the translation.

Updated the test case to test cases where header units can be imported.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128981

Files:
  clang/include/clang/Lex/Preprocessor.h
  clang/lib/Lex/PPDirectives.cpp
  clang/lib/Lex/Preprocessor.cpp
  clang/lib/Parse/Parser.cpp
  clang/test/Modules/cxx20-include-translation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128981.441871.patch
Type: text/x-patch
Size: 17149 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220702/1995657a/attachment-0001.bin>


More information about the cfe-commits mailing list