<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/diagnostics/constexpr-param.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-09-16T19:51:43+00:00</updated>
<entry>
<title>Diagnose error when the function args can't satisfy constexpr parameter requirements (#7269)</title>
<updated>2025-09-16T19:51:43+00:00</updated>
<author>
<name>Gangzheng Tong</name>
<email>tonggangzheng@gmail.com</email>
</author>
<published>2025-09-16T19:51:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=afb8146e10626887e3eb9f479480d4f8a1ad6128'/>
<id>urn:sha1:afb8146e10626887e3eb9f479480d4f8a1ad6128</id>
<content type='text'>
## Summary
This PR enhances constexpr validation by adding proper error checking
when function arguments cannot satisfy constexpr parameter requirements,
addressing issue #6370.

## Problem
Previously, when a function declared constexpr parameters, the compiler
would attempt to propagate constexpr-ness to the call site arguments,
but there was insufficient validation and error reporting when this
propagation failed. This could lead silent failures where constexpr
requirements weren't properly enforced

## Solution
This PR adds checks that:

1. **Validates constexpr arguments**: When a function parameter is
marked as `constexpr`, the compiler now explicitly checks that the
corresponding argument can be marked as `constexpr`

2. **Issues clear compilation errors**: added
`Diagnostics::argIsNotConstexpr`)

3. **Handles both call scenarios**: The validation works for both:
   - Direct function calls with IR-level function definitions
   - Calls to function from external modules

Fixes #6370

---------

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>
