The HLSL language mode in Clang has a lot of leaking C++ features which we need to assess and either disable or extensions and produce adequate warnings to enable shader authors to write portable code.
In order to finalize the sorting of which features end up where we'll need to work through a few HLSL spec proposals tracked by:
Features to Remove
Features to Remove from 202x but enable for 202y
Note: this list based on assuming that we adopt strict initializer lists.
Features to mark as 202y extensions
Features to mark as Clang extensions
Features to figure out what to do with
The HLSL language mode in Clang has a lot of leaking C++ features which we need to assess and either disable or extensions and produce adequate warnings to enable shader authors to write portable code.
In order to finalize the sorting of which features end up where we'll need to work through a few HLSL spec proposals tracked by:
Features to Remove
newanddelete(https://godbolt.org/z/rs777nj7Y)goto(https://godbolt.org/z/jhPbr4fx8)alignof(https://godbolt.org/z/sn3xPM6Yf)dynamic_cast(https://godbolt.org/z/vjv4ojYa3)reinterpret_cast(https://godbolt.org/z/8hsTW5bcE)extern(https://godbolt.org/z/aa5MK35rb) &extern "C"(https://godbolt.org/z/zb9bzKMYo)_Alignas(https://godbolt.org/z/o8cr6fP8P)asmand__asm(https://godbolt.org/z/q6KzhnEqM)...parameters (https://godbolt.org/z/na1za13Pc)dynamic_cast(https://godbolt.org/z/4jzv1Ks1M) - errors but could be betterFeatures to Remove from 202x but enable for 202y
Features to mark as 202y extensions
constexpr(https://godbolt.org/z/jYjsv5Wqj) - We do use this in clang headers so we'll need to disable the warning in our headersdecltype(https://godbolt.org/z/xhzxqWGTY)inline namespace(https://godbolt.org/z/8v3szTs5z)Features to mark as Clang extensions
static_cast,const_cast(https://godbolt.org/z/8hsTW5bcE)frienddeclarations (https://godbolt.org/z/Yoz9dWTj3)Features to figure out what to do with