C++ Logo

sg15

Advanced search

Re: [D3034] Module Declarations Shouldn’t be Macros

From: Daniela Engert <dani_at_[hidden]>
Date: Fri, 3 Nov 2023 19:41:06 +0100
Am 03.11.2023 um 19:34 schrieb Ben Boeckel:
> On Fri, Nov 03, 2023 at 15:13:26 +0100, Daniela Engert via SG15 wrote:
>> Am 03.11.2023 um 14:11 schrieb Boris Kolpackov via SG15:
>>> Michael Spencer<bigcheesegs_at_[hidden]> writes:
>>>
>>>> On Fri, Nov 3, 2023 at 12:43 AM Boris Kolpackov<boris_at_[hidden]>
>>>>
>>>>> #ifdef VERSION
>>>>> export module version;
>>>>> #else
>>>>> export module final;
>>>>> #endif
>>>>>
>>>> This is already banned by the grammar. You can't have an if-group that
>>>> spans a pp-module.
>>> Surprising, but it seems this indeed was banned by P1857. FWIW, neither
>>> GCC 13 nor Clang 17 enforce this.
>> MSVC doesn't either unless you prepend the example with line "module;".
>> In this case MSVC refuses to accept the conditionally compiled module
>> declarations. I have an open bug on DevCom for the non-conforming behaviour.
> Is there a link so that others may track it as well (though I suspect it
> may be behind permission guards)?
>
> --Ben

There you go:
https://developercommunity.visualstudio.com/t/CPreprocessor-Ill-formed-code-is-a/10461894

Dani


-- 
PGP/GPG: 2CCB 3ECB 0954 5CD3 B0DB 6AA0 BA03 56A1 2C4638C5

Received on 2023-11-03 18:41:08