www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22953] New: impossible to test for pragma support

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 puremagic.com
          Reporter: destructionator 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.

--
Mar 28 2022