Date: Fri, 21 May 2021 08:20:58 +0200
On 20/05/2021 23:47, Eric Suen via Std-Discussion wrote:
> I'm writing a cpp parse, constant-expression is conflict with enum-base
> or class base-clause, do I need look ahead and check?
>
> enum A {
> };
>
> struct S {
> enum A :1;
> enum A a:1;
> };
>
> gcc accept both, clang and vs only accept 2nd
[dcl.enum]/1: "A : following 'enum nested-name-specifier_opt identifier'
within the decl-specifier-seq of a member-declaration is parsed as part
of an enum-base."
> I'm writing a cpp parse, constant-expression is conflict with enum-base
> or class base-clause, do I need look ahead and check?
>
> enum A {
> };
>
> struct S {
> enum A :1;
> enum A a:1;
> };
>
> gcc accept both, clang and vs only accept 2nd
[dcl.enum]/1: "A : following 'enum nested-name-specifier_opt identifier'
within the decl-specifier-seq of a member-declaration is parsed as part
of an enum-base."
Received on 2021-05-21 01:21:05