Sema: fix fn pointer align disagrees with fn align error

Check the specified function alignment rather than the effective
function alignment.
This commit is contained in:
Andrew Kelley
2022-07-21 15:16:59 -07:00
parent fc6e111b76
commit 25f3be32db
2 changed files with 10 additions and 5 deletions

View File

@@ -16,10 +16,13 @@ comptime {
var a: *align(2) fn () void = undefined;
_ = a;
}
comptime {
var a: *align(1) fn () align(2) void = undefined;
_ = a;
}
// error
// backend=stage2
// target=x86_64-linux
// target=native
//
// :2:19: error: function pointer alignment disagrees with function alignment
// :16:19: error: function pointer alignment disagrees with function alignment
// :20:19: error: function pointer alignment disagrees with function alignment