diff --git a/src/Sema.zig b/src/Sema.zig index a79d57216ed4..cc1a0836628c 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -7557,7 +7557,7 @@ fn funcCommon( } if (cc_workaround == .Inline and is_noinline) { - return sema.fail(block, cc_src, "callconv(.Inline) and noinline are incompatible together", .{}); + return sema.fail(block, cc_src, "'noinline' function cannot have callconv 'Inline'", .{}); } break :fn_ty try Type.Tag.function.create(sema.arena, .{ diff --git a/test/cases/compile_errors/noinline_fn_cc_inline.zig b/test/cases/compile_errors/noinline_fn_cc_inline.zig new file mode 100644 index 000000000000..3a2d6440c3a6 --- /dev/null +++ b/test/cases/compile_errors/noinline_fn_cc_inline.zig @@ -0,0 +1,12 @@ +const cc = .Inline; +noinline fn foo() callconv(cc) void {} + +comptime { + _ = foo; +} + +// error +// backend=stage2 +// target=native +// +// :2:28: error: 'noinline' function cannot have callconv 'Inline'