Open
Description
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
- Multiple Inheritance (https://godbolt.org/z/Kccj6MrGz)
- Operator
new
anddelete
(https://godbolt.org/z/rs777nj7Y) goto
(https://godbolt.org/z/jhPbr4fx8)- variadic functions (https://godbolt.org/z/3a8Ezovn6)
alignof
(https://godbolt.org/z/sn3xPM6Yf)- exception specifiers (https://godbolt.org/z/he3T653r4)
- exception try/catch/throw (https://godbolt.org/z/f7ePzjPxY)
- Runtime Type Information (RTTI) &
dynamic_cast
(https://godbolt.org/z/vjv4ojYa3) reinterpret_cast
(https://godbolt.org/z/8hsTW5bcE)
Features to Remove from 202x but enable for 202y
Note: this list based on assuming that we adopt strict initializer lists.
- Union types (https://godbolt.org/z/5rzr8dGxo)
- User-defined constructors and destructors (https://godbolt.org/z/Mq5nxzPsd)
- Default member initializers (https://godbolt.org/z/svszGo37j)
- Access specifiers (https://godbolt.org/z/7j584arxe)
- Friend declarations (https://godbolt.org/z/a6cPG6fGs)
Features to mark as 202y extensions
- Global operator overloading
- Conversion operators
- Const instance methods
constexpr
(https://godbolt.org/z/jYjsv5Wqj) - We do use this in clang headers so we'll need to disable the warning in our headers- Variadic templates (https://godbolt.org/z/751We3o18)
decltype
(https://godbolt.org/z/xhzxqWGTY)inline namespace
(https://godbolt.org/z/8v3szTs5z)
Features to mark as Clang extensions
static_cast
(https://godbolt.org/z/8hsTW5bcE)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status