C++ Logo


Advanced search

Re: Header unit importation syntax

From: Maris Razvan <razvyboy2004_at_[hidden]>
Date: Sat, 24 Aug 2019 08:36:41 +0300
Thank you for your answer.

I read more about the import directive and I came to the following
conclusion: a line containing "import pp-tokens;" is a preprocessing
directive (as stated in eel.is/c++draft/cpp#1) and it should be first
processed by the preprocessor (in case it matches the first two
production rules of the pp-import non-terminal macro definitions
should be imported). Next, the same line should be then translated
(processed by the compiler), even if it matches the first two
production rules or the third one, correct? However, being a
preprocessing directive, it is deleted at the end of translation phase
4. Therefore it cannot be seen by the compiler, right?

On Sat, Aug 24, 2019 at 12:43 AM Michael Spencer <bigcheesegs_at_[hidden]> wrote:
> On Fri, Aug 23, 2019 at 2:13 PM Maris Razvan via Std-Discussion <std-discussion_at_[hidden]> wrote:
>> Hello,
>> In the current C++ draft (august 2019), the grammar for a pp-import
>> (http://eel.is/c++draft/cpp.import#nt:pp-import) allows for additional
>> pp-tokens after the header-name or the header-name-tokens.
>> The current version of that section is the result of P1703:
>> "Recognizing Header Unit Imports Requires Full Preprocessing"
>> (http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1703r1.html).
>> Before the changes caused by this proposal, the grammar still allowed
>> for preprocessing tokens tokens after the header-name or the
>> header-name-tokens, but in the form of a pp-import-suffix. (section
>> [cpp.module] of P1103
>> (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1103r3.pdf)).
>> What is the reasoning behind allowing additional, unused preprocessing
>> tokens in this context?
>> Thank you.
>> --
>> Std-Discussion mailing list
>> Std-Discussion_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
> The reason is to allow attributes.
> - Michael Spencer

Received on 2019-08-24 00:38:55