mirror of
https://github.com/ziglang/zig.git
synced 2026-01-25 00:35:20 +00:00
parent
3db8cffa3b
commit
0eddf0cbc0
@ -8820,7 +8820,9 @@ fn analyzeParameter(
|
||||
};
|
||||
return sema.failWithOwnedErrorMsg(msg);
|
||||
}
|
||||
if (!this_generic and is_noalias and !param.ty.isPtrAtRuntime()) {
|
||||
if (!sema.is_generic_instantiation and !this_generic and is_noalias and
|
||||
!(param.ty.zigTypeTag() == .Pointer or param.ty.isPtrLikeOptional()))
|
||||
{
|
||||
return sema.fail(block, param_src, "non-pointer parameter declared noalias", .{});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
fn f(noalias x: i32) void { _ = x; }
|
||||
export fn entry() void { f(1234); }
|
||||
|
||||
fn generic(comptime T: type, noalias _: [*]T, noalias _: [*]const T, _: usize) void {}
|
||||
comptime { _ = generic; }
|
||||
|
||||
fn slice(noalias _: []u8) void {}
|
||||
comptime { _ = slice; }
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user