[clang] [HLSL][Matrix] Add Matrix Layout Keywords (PR #192284)

Deric C. via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 10:57:27 PDT 2026


================
@@ -1043,6 +1043,13 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
       continue;
     }
 
+    if (auto *A = dyn_cast<HLSLMatrixLayoutAttr>(TmplAttr)) {
+      if (!New->hasAttr<HLSLMatrixLayoutAttr>())
+        New->addAttr(A->clone(Context));
+      HLSL().diagnoseInstantiatedMatrixLayoutAttr(New, A);
----------------
Icohedron wrote:

Perhaps `diagnoseInstantiatedMatrixLayoutAttr` should occur before attaching the attribute and bail if the diagnosis fails, rather than attaching the attribute regardless of the result of the diagnosis?

https://github.com/llvm/llvm-project/pull/192284


More information about the cfe-commits mailing list