www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22029] New: importC: Parser accepts storage-class specifiers

https://issues.dlang.org/show_bug.cgi?id=22029

          Issue ID: 22029
           Summary: importC: Parser accepts storage-class specifiers for
                    fields
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

As per 6.7.2.1

member-declaration:
  static_assert-declaration
  attribute-specifier-sequence(opt) specifier-qualifier-list
        member-declarator-list(opt) ; 

This is invalid, but it's accepted by dmd
---
struct S
{
  typedef int tfield;
  extern int efield;
  static int sfield;
  _Thread_local int tifield;
  auto int afield;
  register int rfield;
};
---

--
Jun 16