<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/diagnostics/void-function-returning-value.slang.expected, 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>2021-02-12T19:31:56+00:00</updated>
<entry>
<title>Diagnostic location highlighting (#1700)</title>
<updated>2021-02-12T19:31:56+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2021-02-12T19:31:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=369279e91dde1b056d8d0e3bb83e7ba3f96321af'/>
<id>urn:sha1:369279e91dde1b056d8d0e3bb83e7ba3f96321af</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* WIP: First pass in supporting output of line error information.

* Add support for lexing to better be able to indicate SourceLocation information.

* Fix lexer usage in DiagnosticSink in C++ extractor.

* Update diagnostics tests to have line location info.

* Fixed test expected output that now have source location information in them.

* Better handling of tab.

* Fix test expected results for tabbing change.

* DiagnosticLexer -&gt; DiagnosticSink::SourceLocationLexer
Added line continuation tests.

* Fix typo.

* Added String::appendRepeatedChar

* Change to rerun tests.

Co-authored-by: Tim Foley &lt;tfoleyNV@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Remove implicit conversions to `void` (#1388)</title>
<updated>2020-06-15T19:05:04+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2020-06-15T19:05:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d84cfb766b089c03f9545588a8590efea1749770'/>
<id>urn:sha1:d84cfb766b089c03f9545588a8590efea1749770</id>
<content type='text'>
* Remove implicit conversions to `void`

Fixes #1372

The standard library code had accidentally introduced implicit-conversion `__init` operations on the `void` type that accepted each of the other basic types, so that a function written like:

```hlsl
void bad() { return 1; }
```

would translate to:

```hlsl
void bad() { return (void)1; }
```

The dual problesm are that the input code should have produced a diagnostic of some kind, and the output code doesn't appear to compile correctly through fxc.

This change introduces several fixes aimed at this issue:

* First, the problem in the stdlib code is plugged: we don't introduce implicit conversion operations *to* or *from* `void` (we'd only been banning it in one direction before)

* Next, an explicit `__init` was added to `void` that accepts *any* type so that existing HLSL code that might do `(void) someExpression` to ignore a result will continue to work. This is a compatibility feature, and it might be argued that we should at least warn when it is used. Note that this function is expected to never appear in output HLSL/GLSL because its result will never be used, and it is marked `[__readNone]` allowing calls to it to be eliminated as dead code.

* During IR lowering, we now take care to only emit the `IRReturnVal` instruction type if there is a non-`void` value being returned, and use `IRReturnVoid` for both the case where no expression was used in the `return` statement *and* the case where an expression of type `void` is returned.

* A test case was added to confirm that returning `1` from a `void` function isn't allowed, while returning `(void) 1` *is*.

The net result of these changes is that we now produce an error for the bad input code, we allow explicit casts to `void` as a compatibility feature, and we are more robust about treating `void` as if it is an ordinary type in the front-end.

* fixup: missing file</content>
</entry>
</feed>
