diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-14 14:45:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-14 14:45:57 -0700 |
| commit | f5f0740be8102b4d719575d97b00dbd21b54ffbe (patch) | |
| tree | 3ca8da03f4ff12a11a42370d17bcd9593a103cfd /source/slang/slang-check-modifier.cpp | |
| parent | 78d4df0644b20b8ba4eeff459c749c4e8d261345 (diff) | |
Support unscoped enums. (#3771)
Diffstat (limited to 'source/slang/slang-check-modifier.cpp')
| -rw-r--r-- | source/slang/slang-check-modifier.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index 6359096b9..eae993dc7 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -1173,7 +1173,15 @@ namespace Slang // the right syntax class to instantiate. // - return checkAttribute(hlslUncheckedAttribute, syntaxNode); + auto checkedAttr = checkAttribute(hlslUncheckedAttribute, syntaxNode); + + if (as<UnscopedEnumAttribute>(checkedAttr)) + { + if (auto parentDecl = as<ContainerDecl>(getParentDecl(as<Decl>(syntaxNode)))) + parentDecl->invalidateMemberDictionary(); + return getASTBuilder()->create<TransparentModifier>(); + } + return checkedAttr; } if (auto decl = as<Decl>(syntaxNode)) |
