C++ Logo

STD-DISCUSSION

Advanced search

Subject: bit field: is enum A : 1 valid syntax?
From: Eric Suen (eric_suen_at_[hidden])
Date: 2021-05-20 16:47:48


Hello,

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

Regards,

Eric


STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups