-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluation
Description
We support vector types, so supporting matrices as well would make sense, even though it sounds like it’d be quite a bit of work as it would probably involve adding a new APValue kind.
As an example, this (https://godbolt.org/z/WE84hhYvP):
template <typename T>
constexpr bool f() {
T t = T();
return true;
}
using M = int [[clang::matrix_type(4, 4)]];
static_assert(f<M>());doesn’t work currently:
<source>:9:15: error: static assertion expression is not an integral constant expression
9 | static_assert(f<M>());
| ^~~~~~
<source>:3:11: note: non-literal type 'int __attribute__((matrix_type(4, 4)))' cannot be used in a constant expression
3 | T t = T();
| ^
<source>:9:15: note: in call to 'f<int __attribute__((matrix_type(4, 4)))>()'
9 | static_assert(f<M>());
| ^~~~~~Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluationAnything related to constant evaluation