summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-modifier.cpp
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2024-05-01 10:46:21 -0700
committerGitHub <noreply@github.com>2024-05-01 10:46:21 -0700
commit853987defb7090d77938593c271413d92447f7b1 (patch)
tree2fbf03db310d2c50351206674d7abb33333adcad /source/slang/slang-check-modifier.cpp
parentca62ec2591de40e7c8226330670cc8c8d4840065 (diff)
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.
Diffstat (limited to 'source/slang/slang-check-modifier.cpp')
-rw-r--r--source/slang/slang-check-modifier.cpp5
1 files changed, 5 insertions, 0 deletions
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;
}