C++ Logo

sg15

Advanced search

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

From: Boris Kolpackov <boris_at_[hidden]>
Date: Fri, 3 Nov 2023 15:11:15 +0200
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.

I guess if this is disabled, then disabling macro expansion in the
module name is the natural next step.

Received on 2023-11-03 13:11:22