File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,10 @@ void Preprocessor::Lex(Token &Result) {
902
902
case tok::r_brace:
903
903
StdCXXImportSeqState.handleCloseBrace ();
904
904
break ;
905
+ #define PRAGMA_ANNOTATION (X ) case tok::annot_##X:
906
+ // For `#pragma ...` mimic ';'.
907
+ #include " clang/Basic/TokenKinds.def"
908
+ #undef PRAGMA_ANNOTATION
905
909
// This token is injected to represent the translation of '#include "a.h"'
906
910
// into "import a.h;". Mimic the notional ';'.
907
911
case tok::annot_module_include:
Original file line number Diff line number Diff line change
1
+ // RUN: rm -fR %t
2
+ // RUN: split-file %s %t
3
+ // RUN: cd %t
4
+ // RUN: %clang_cc1 -verify -std=c++20 -emit-header-unit -xc++-user-header bz0.h
5
+ // RUN: %clang_cc1 -verify -std=c++20 -emit-header-unit -xc++-user-header -fmodule-file=bz0.pcm bz.cpp
6
+
7
+ // --- compare
8
+ #pragma GCC visibility push(default)
9
+ #pragma GCC visibility pop
10
+
11
+ // --- bz0.h
12
+ #include " compare"
13
+ // expected-no-diagnostics
14
+
15
+ // --- bz.cpp
16
+ #include " compare"
17
+
18
+ import " bz0.h" ; // expected-warning {{the implementation of header units is in an experimental phase}}
You can’t perform that action at this time.
0 commit comments