From 853987defb7090d77938593c271413d92447f7b1 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Wed, 1 May 2024 10:46:21 -0700 Subject: Add ParamDecl as the attribute target (#4067) Currently we only allow variable, struct, and function as the target for the user-defined attribute, this change adds the function parameter to the target as well. --- source/slang/slang-check-modifier.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-check-modifier.cpp') diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index 13ad8be3a..56d905063 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -318,6 +318,11 @@ namespace Slang cls = m_astBuilder->findSyntaxClass(UnownedStringSlice::fromLiteral("FuncDecl")); return true; } + if (typeFlags == (int)UserDefinedAttributeTargets::Param) + { + cls = m_astBuilder->findSyntaxClass(UnownedStringSlice::fromLiteral("ParamDecl")); + return true; + } return false; } -- cgit v1.2.3