================
@@ -300,7 +300,11 @@ int test_extract_template(MyMatrix<int, 2, 2> Mat1) {
 using double4x4 = double __attribute__((matrix_type(4, 4)));
 
 template <class R, class C>
-auto matrix_subscript(double4x4 m, R r, C c) -> decltype(m[r][c]) {}
+auto matrix_subscript(double4x4 m, R r, C c) -> decltype(m[r][c]) {
+  // FIXME: We can't actually do 'return m[r][c]' here currently.
+  static double d;
----------------
Sirraide wrote:

I’m not entirely sure candidly. On the one hand, maybe exposing a reference to 
a matrix element is just fundamentally a bad idea, but on the other, support 
for matrix types is also incomplete in other areas (e.g. list initialisation 
doesn’t work at all, not even e.g. `some_matrix_type{}`). I don’t really know 
which one is the case here, so I felt like I should maybe point out why I’m 
solving the problem of having to return a `double&` in a weird way here.

https://github.com/llvm/llvm-project/pull/123464
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to