diff options
| author | Yong He <yonghe@outlook.com> | 2024-05-15 18:07:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-15 18:07:36 -0700 |
| commit | 3b0de8b6ea484091146f61e663c63beeac5b4798 (patch) | |
| tree | 8093bc0af8d0801435c29abf5c5f1fdd3e7cc09a /source/slang/slang-check-conformance.cpp | |
| parent | cc88530a722cc2ce7a09f2a39dadeeb504e2f221 (diff) | |
Add diagnostic to prevent defining unsized variables. (#4168)
* Add diagnostic to prevent defining unsized static variables.
* Fix tests.
* Add more tests.
* Fix to allow defining variables of link-time size.
* update diagnostic message.
* Fix tests.
* Simplify code.
Diffstat (limited to 'source/slang/slang-check-conformance.cpp')
| -rw-r--r-- | source/slang/slang-check-conformance.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp index a0e51b180..394d0693f 100644 --- a/source/slang/slang-check-conformance.cpp +++ b/source/slang/slang-check-conformance.cpp @@ -274,7 +274,8 @@ namespace Slang } else if (auto intVal = arrayType->getElementCount()) { - sized = !intVal->isLinkTimeVal(); + sized = true; + typeTag = (TypeTag)((int)typeTag | (int)TypeTag::LinkTimeSized); } if (!sized) typeTag = (TypeTag)((int)typeTag | (int)TypeTag::Unsized); |
