[Issue 24475] New: ImportC: allow _Alignof expression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 1 05:25:42 UTC 2024


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

          Issue ID: 24475
           Summary: ImportC: allow _Alignof expression
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dave287091 at gmail.com

C standard only defines:

  _Alignof ( type-name )

whereas sizeof is defined as:

  sizeof unary-expression 
  sizeof ( type-name )

However, gcc and clang also accept

  _Alignof unary-expression

with the obvious semantics of an implicit typeof on the unary-expression, in
the same manner as sizeof.

I’ve encountered this in some code.

--


More information about the Digitalmars-d-bugs mailing list