[Issue 8887] static arrays passed by value in extern C/C++ functions should not compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 14 12:50:20 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=8887

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com

--- Comment #20 from RazvanN <razvan.nitu1305 at gmail.com> ---
(In reply to Andrej Mitrovic from comment #0)
> extern(C) void fail(int[4] x);
> extern(C) int[4] fail2();
> extern(C++) void fail3(int[4] x);
> extern(C++) int[4] fail4();
> 
> These should fail since C/C++ compilers always pass arrays by pointer to
> first element.

The last 2 declarations fails in today's compiler. I guess we can do the same
for the first 2.

--


More information about the Digitalmars-d-bugs mailing list