File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 512
512
\end {footnote }
513
513
These rules can in turn lead to the importation of yet more
514
514
translation units.
515
+ \begin {note }
516
+ Such indirect importation does not make macros available,
517
+ because a translation unit is
518
+ a sequence of tokens in translation phase 7\iref {lex.phases }.
519
+ Macros can be made available by directly importing header units
520
+ as described in \ref {cpp.import }.
521
+ \end {note }
515
522
516
523
\pnum
517
524
A module implementation unit shall not be exported.
Original file line number Diff line number Diff line change 929
929
int a = Y; // OK, active macro definitions \# 2 and \# 4 are valid redefinitions
930
930
int c = Z; // error: active macro definitions \# 3 and \# 5 are not valid redefinitions of \tcode {Z}
931
931
\end {codeblocktu }
932
+
933
+ \begin {codeblocktu }{Module unit \tcode {f}}
934
+ export module f;
935
+ export import "a.h" ;
936
+
937
+ int a = Y; // OK
938
+ \end {codeblocktu }
939
+
940
+ \begin {codeblocktu }{Translation unit \tcode {\# 1}}
941
+ import f;
942
+ int x = Y; // error: \tcode {Y} is neither a defined macro nor a declared name
943
+ \end {codeblocktu }
932
944
\end {example }
933
945
\indextext {macro!import|)}
934
946
You can’t perform that action at this time.
0 commit comments