aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWooster <wooster0@proton.me>2023-09-21 18:13:41 +0200
committerAndrew Kelley <andrew@ziglang.org>2023-09-22 12:23:57 -0700
commit4585cb1e2ff6afdb23748bd020ccf8e850550510 (patch)
tree543dc8dd76da0bbb33dc90ada4af91afafd5a7cb /test
parent3fc74135749e32ba106572ed85a2e253b89fb0c6 (diff)
downloadzig-4585cb1e2ff6afdb23748bd020ccf8e850550510.tar.gz
zig-4585cb1e2ff6afdb23748bd020ccf8e850550510.zip
AstGen: fix @export with undeclared identifier crashing
This required a third `if (found_already == null)` in another place in AstGen.zig for this special case of `@export`. Fixes #17188
Diffstat (limited to 'test')
-rw-r--r--test/cases/compile_errors/@export_with_undeclared_identifier.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/cases/compile_errors/@export_with_undeclared_identifier.zig b/test/cases/compile_errors/@export_with_undeclared_identifier.zig
new file mode 100644
index 0000000000..01c3b4000e
--- /dev/null
+++ b/test/cases/compile_errors/@export_with_undeclared_identifier.zig
@@ -0,0 +1,9 @@
+export fn a() void {
+ @export(bogus, .{ .name = "bogus_alias" });
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :2:13: error: use of undeclared identifier 'bogus'