C++ Logo

sg15

Advanced search

Re: [isocpp-core] Named modules, macros, and re-exporting header units

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Wed, 21 Dec 2022 19:03:28 +0000
[Jens]
> A "translation unit" is a sequence of tokens that are (only) lexically valid.

Interesting.
In that case, the sentence "The resulting tokens are syntactically and semantically analyzed and translated as a translation unit." could use a clarification.
The terms "translation unit" and "translated translation unit" are not defined anywhere - as in "italicized terms".

> Maybe such a thing doesn't exist in your implementation.

Yes, but that should be irrelevant :-)

-- Gaby

-----Original Message-----
From: Jens Maurer <jens.maurer_at_[hidden]>
Sent: Sunday, December 18, 2022 2:02 AM
To: Gabriel Dos Reis <gdr_at_microsoft.com>; core_at_lists.isocpp.org
Cc: sg15_at_lists.isocpp.org
Subject: Re: [isocpp-core] Named modules, macros, and re-exporting header units

On 18/12/2022 04.19, Gabriel Dos Reis wrote:
> [Jens]
>> This clearly refers to "translation units", and translation units are a phase 7 concept per [lex.phases] p7:
>> "Whitespace characters separating tokens are no longer significant. Each preprocessing token is converted
>> into a token (5.6). The resulting tokens are syntactically and semantically analyzed and translated as a
>> translation unit."
>
> In that case, what is the difference between "translation units" and "translated translation units"?

A "translation unit" is a sequence of tokens that are (only) lexically valid.

Looking at phase 8 (template instantiation), a "translated translation unit" is some
unspecified intermediate thing where all non-dependent constructs have been semantically
analyzed, but no templates have been instantiated yet. Maybe such a thing doesn't exist
in your implementation.

Jens

Received on 2022-12-21 19:03:31