C++ Logo

sg15

Advanced search

Re: [SG15] [isocpp-modules] Determining identity like #pragma once

From: Bryce Adelstein Lelbach aka wash <brycelelbach_at_[hidden]>
Date: Wed, 10 Jul 2019 14:49:44 -0700
Right, but then, IIUC, that means we can't end up in the sort of
unexpected situation Gaby described.

If I have:

import <x>;
#include <x>

or

#include <x>
import <x>;

In both of these cases, if x is not an importable header, the program
is ill formed. If it is an importable header, the order doesn't
matter, because the include gets translated into an import.

Correct?

On Wed, Jul 10, 2019 at 2:42 PM Ville Voutilainen
<ville.voutilainen_at_[hidden]> wrote:
>
> On Thu, 11 Jul 2019 at 00:39, Bryce Adelstein Lelbach aka wash
> <brycelelbach_at_[hidden]> wrote:
> >
> > On Wed, Jul 10, 2019 at 12:09 PM Ville Voutilainen
> > <ville.voutilainen_at_[hidden]> wrote:
> > >
> > > On Wed, 10 Jul 2019 at 22:06, Tom Honermann <tom_at_[hidden]> wrote:
> > >
> > > > You are implying that the include translation is mandatory. Is that your argument?
> > > >
> > > > Yes. The wording in [cpp.include]p7 seems fairly clear regarding that.
> > >
> > > Not at all. "If the header identified by the header-name denotes an
> > > importable header" is implementation-defined. The set
> > > of importable headers is allowed to be whatever the implementation
> > > decides, including an empty set.
> >
> > Not exactly.
> >
> > http://eel.is/c++draft/module.import#5 says "A
> > module-import-declaration that specifies a header-name H imports a
> > synthesized header unit ..." and later "H shall identify an importable
> > header."
> >
> > So H must be a part of that set of importable headers. Yes?
>
> Well, if it's not, the program is ill-formed. Did you read
> http://lists.isocpp.org/modules/2019/07/0490.php ?



-- 
Bryce Adelstein Lelbach aka wash
CUDA Core C++ Libraries Lead @ NVIDIA
ISO C++ Library Evolution Incubator Chair
ISO C++ Tooling Chair
CppCon and C++Now Program Chair
CUDA Convert and Reformed AVX Junkie
Sleep is for the weak
--

Received on 2019-07-10 16:52:04