<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/bugs/static-const-without-default-value.slang, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2025-07-30T21:23:27+00:00</updated>
<entry>
<title>disallow `static const` variables without default-value (#7993)</title>
<updated>2025-07-30T21:23:27+00:00</updated>
<author>
<name>ArielG-NV</name>
<email>159081215+ArielG-NV@users.noreply.github.com</email>
</author>
<published>2025-07-30T21:23:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c4dd2eb0033b3eaf683791a6666cff63aeb9f139'/>
<id>urn:sha1:c4dd2eb0033b3eaf683791a6666cff63aeb9f139</id>
<content type='text'>
* Fix static const variables without initializers causing internal errors

Add validation in SemanticsDeclHeaderVisitor::checkVarDeclCommon to detect static const variables without initializers and emit proper error diagnostics instead of allowing internal errors to escape during SPIR-V generation.

- Add new diagnostic (ID 31225) for static const variables without initializers
- Skip validation for extern static const variables
- Skip validation for interface member variables
- Add comprehensive test case covering various scenarios

Fixes #7989

Co-authored-by: ArielG-NV &lt;ArielG-NV@users.noreply.github.com&gt;

* clean up test and implementation

* format code (#7994)

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;

---------

Co-authored-by: github-actions[bot] &lt;41898282+github-actions[bot]@users.noreply.github.com&gt;
Co-authored-by: ArielG-NV &lt;ArielG-NV@users.noreply.github.com&gt;
Co-authored-by: slangbot &lt;ellieh+slangbot@nvidia.com&gt;
Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
</feed>
