Issue 178509
Summary [HLSL] Crash when compiling valid overload set
Labels HLSL
Assignees
Reporter spall
    This case crashes due to a null pointer.
```
export void fn1(int foo[2]);
export void fn1(inout int foo[2]);
```
https://godbolt.org/z/95K87ed37
https://godbolt.org/z/s5YYozzc5 (the reverse order also crashes)

This case is equivalent but successfully produces the diagnostic the above case is attempting to produce.
```
export void fn1(in int foo[2]);
export void fn1(inout int foo[2]);
```
the error: (NOTE: this is a valid overload set in DXC)
```
source>:2:27: error: conflicting parameter qualifier 'inout' on parameter 'foo'
    2 | export void fn1(inout int foo[2]);
      | ^
<source>:1:24: note: previously declared as 'in' here
    1 | export void fn1(in int foo[2]);
```
https://godbolt.org/z/qMr3Pro6c

A similar overload set using vectors instead of arrays is similarly legal in both Clang and DXC.
```
export void fn1(inout int2 foo);
export void fn1(int2 foo);
```
https://godbolt.org/z/zcn3Ghh6h

In summary there seems to be an issue with how overloads for functions with array parameters are handled and incidentally there is an associated crash.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to