www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21965] New: importC: Anonymous top-level struct or union


          Issue ID: 21965
           Summary: importC: Anonymous top-level struct or union triggers
                    AssertError dsymbolsem.d(4787)
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

Similar to issue 21945, but this is for structs and unions that define no

struct { int var; };
typedef struct { int var };

Both examples produce warnings with a C compiler as they are no-op.  It should
perhaps be an error with D though, as such declarations are semantically
invalid, as per the assertions that it triggers.

May 24 2021