[Issue 22953] New: impossible to test for pragma support

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 28 22:58:56 UTC 2022


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

          Issue ID: 22953
           Summary: impossible to test for pragma support
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: destructionator at gmail.com

It is impossible to test if a given pragma is supported in D.
__traits(compiles) doesn't work since a pragma is not an expression, and
wrapping it in a function can fail because some pragmas can only be used top
level.

This makes writing code that supports multiple versions of the compiler
unnecessarily difficult.

--


More information about the Digitalmars-d-bugs mailing list