From 21a66267c661a55c8ad27248c0765276dd6f72ea Mon Sep 17 00:00:00 2001 From: Gangzheng Tong Date: Tue, 15 Jul 2025 16:39:22 -0700 Subject: Emit additional diagnostic for invalid pointer taking operations (#7663) * Emit special diagnostic for invalid pointer taking operations * Update source/slang/slang-diagnostic-defs.h Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> * Add OperatorAddressOf KnownBuiltin modifier * update error message for non-l-value assignment * update the diagnostics in the tests * Use enum based KnownBuiltinDeclName * format code (#7772) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --------- Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Co-authored-by: slangbot Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- tests/diagnostics/implicit-cast-lvalue.slang.expected | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/diagnostics/implicit-cast-lvalue.slang.expected') diff --git a/tests/diagnostics/implicit-cast-lvalue.slang.expected b/tests/diagnostics/implicit-cast-lvalue.slang.expected index 10ebfc656..93217b239 100644 --- a/tests/diagnostics/implicit-cast-lvalue.slang.expected +++ b/tests/diagnostics/implicit-cast-lvalue.slang.expected @@ -7,6 +7,7 @@ tests/diagnostics/implicit-cast-lvalue.slang(19): error 30047: argument passed t a(y); ^ tests/diagnostics/implicit-cast-lvalue.slang(19): note 30063: argument was implicitly cast from 'double' to 'float', and Slang does not support using an implicit cast as an l-value with this type +tests/diagnostics/implicit-cast-lvalue.slang(19): note 30049: attempting to assign to a const variable or immutable member; use '[mutating]' attribute on the containing method to allow modification } standard output = { } -- cgit v1.2.3