C++ Logo

sg15

Advanced search

Re: [D1689R5] Draft addition of the `is-interface` key

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Fri, 13 May 2022 17:17:25 -0400
Em sex., 13 de mai. de 2022 às 16:36, Ben Boeckel via SG15
<sg15_at_[hidden]> escreveu:
> Attached is a draft of P1689R5

Is it? Maybe the mailing list ate it?

> For C++, this means "has the `export` keyword. In order to avoid a
> bikeshed round of meeting time, I'd like to read the winds as to how
> this should be named:
> - `"is-interface"` (defaults to `true`): the draft has this

I second that opinion. It is consistent with the terminology we discussed.

> Orthogonally, there's also the question of:
> - no default value (it must always be present in the file)

I think having no default is the correct thing to do. You could have a
default of null, if we want to allow it not to be specified. Then any
tooling that needs to know and doesn't receive knows it can't presume
one way or another. I'd argue it's cheap enough to identify that it
shouldn't be optional, though.

> Note that, as far as I know, the only reason we need this information
> for building modules in the first place is to provide the appropriate
> `-interface` or `-internalPartition` flag to MSVC for compilation for
> the source file.

Yes, it would be nice if there was a "-importableUnit" so the tooling
wouldn't have to care.

> Is this useful for static analysis or other tools as
> well (AFAIK, this information is readily available by anything that can
> read the source anyways)?

Yes, but it would likely result in a second read of the source file.
If the compiler is already reading it to get the dependencies, so I
can see tooling decide *not* to care about the non-interface files.

daniel

Received on 2022-05-13 21:17:37