C++ Logo

std-discussion

Advanced search

Re: Header unit importation syntax

From: Maris Razvan <razvyboy2004_at_[hidden]>
Date: Sun, 25 Aug 2019 13:30:51 +0300
Or is it that because the "import" token is replaced by the
"import-keyword" token, the line is not considered a preprocessing
directive anymore, therefore it is not removed?

On Sat, Aug 24, 2019 at 8:36 AM Maris Razvan <razvyboy2004_at_[hidden]> wrote:
>
> 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-25 05:33:05