[clang] [HLSL] Warn on duplicate is_rov attribute; remove unnecessary parentheses (PR #107973)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 10 10:37:06 PDT 2024


================
@@ -8844,7 +8844,11 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type,
     }
     case ParsedAttr::AT_HLSLResourceClass:
     case ParsedAttr::AT_HLSLROV: {
-      if (state.getSema().HLSL().handleResourceTypeAttr(attr))
+      // Only collect HLSL resource type attributes that are in
+      // decl-specifier-seq; do not collect attributes on declarations or those
+      // that get to slide after declaration name.
+      if (TAL == TAL_DeclSpec &&
+          state.getSema().HLSL().handleResourceTypeAttr(attr))
----------------
hekota wrote:

When a type attribute is on a declaration the error is reported later on after this processing happens, but we want to avoid collecting these attributes in SemaHLSL.

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


More information about the cfe-commits mailing list