C++ Logo

std-discussion

Advanced search

Re: Exported redeclarations

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Wed, 16 Feb 2022 17:32:48 -0500
On Wed, Feb 16, 2022 at 5:11 PM Vladimir Grigoriev via Std-Discussion
<std-discussion_at_[hidden]> wrote:
>
> What is the difference between these two phrase
>
> An exported redeclaration of a non-exported declaration of an entity is ill-formed.
>
> and
>
> A name is exported by a module if it is redeclared by an exported declaration in the purview of that module.

The second phrase does not appear in the C++20 standard (at least not
N4861, nor the current working draft). In N4861, we see "A name is
exported by a module if it is introduced or redeclared by an exported
declaration in the purview of that module." in section 10.1/7. So
there doesn't seem to be a problem here; the wording is a bit
imprecise (since it's not possible to redeclare an entity as exported
if it was not introduced as exported), but still valid.

For what it's worth, the current working draft doesn't even bother
with that statement, relying entirely on 10.1/2 for what it means to
export something.

Received on 2022-02-16 22:33:00