[GSoC] Header Generation for C/C++

Iain Buclaw ibuclaw at gdcproject.org
Thu Jul 18 05:02:03 UTC 2019


On Wed, 17 Jul 2019 at 23:00, Manu via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wed, Jul 17, 2019 at 11:45 AM Eduard Staniloiu via Digitalmars-d
> <digitalmars-d at puremagic.com> wrote:
> >
> > On Wednesday, 17 July 2019 at 17:43:21 UTC, Manu wrote:
> > > On Wed, Jul 17, 2019 at 6:40 AM Eduard Staniloiu via
> > > Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> > >>
> > >> I want to give a heads-up to everyone for the following issue
> > >> (this had me scratching my head for a couple of days unit I
> > >> caught it):
> > >>
> > >> The current code doesn't take into account `enum BaseType`s,
> > >> ex:
> > >> ```
> > >> enum TOK : ubyte { /* ... */ }
> > >>
> > >> class Expression
> > >> {
> > >>    TOK op;
> > >>    /* ... */
> > >> }
> > >> ```
> > >>
> > >> The `enum TOK` above gets generated as
> > >> ```
> > >> enum TOK { /* ... */ }
> > >> ```
> > >
> > > So... use:
> > >
> > > enum class TOK : unsigned char { /* */ };
> > >
> > > ??
> >
> > That’s what I would like to use, but `enum class`es are starting
> > with C++11
> >
> > This will also lead to breaking code as the fields must now be
> > accessed as `TOK::field`.
> >
> > That being said, I think C++11 would be nice
>
> Breaking what? This feature doesn't exist yet! There's nobody with
> code written against these generated headers...
>

LDC and GDC builds will break as a result of switching to
auto-generated headers, but that's expected when things switch to
mechanical naming anyway...  we'll need to update our side of the
compiler regardless.

-- 
Iain



More information about the Digitalmars-d mailing list