Most C++ compilers I've worked wouldn't let you use it unless the compilation unit was compiled as C and then linked externally.
In the same way I could totally define alloca in a C symbol and then just extern it into Rust if I wanted to.
[edit]
Realized I was thinking of VLAs but I think the point still stands.
Reading https://www.gnu.org/software/gnulib/manual/html_node/alloca...., I think gcc C++ supports alloca on most systems (“There are a few systems where this is not possible: HP-UX systems, and some other platforms when the C++ compiler is used. On these platforms the alloca module provides a malloc based emulation”)
VLAs are different, I think.
C has standardized dynamically sized automatic arrays which is close enough to alloca. The standard wouldn't concern itself of were the space is actually allocated, just mandate that it is freed when the function terminates.
Removed from the last C Standard. It was recognized as a mistake.
AFAIK, in practice, many C++ compilers support alloca for compatibility with gcc (or more specifically, its C library)
Also, is alloca part of any C standard? I can’t find evidence for that easily. Also, if so, https://en.wikipedia.org/wiki/Stack-based_memory_allocation#... needs updating. It currently says
“The function was present on Unix systems as early as 32/V (1978), but is not part of Standard C or any POSIX standard.”
I also don’t see how it could be part of the standard, as that, AFAIK, doesn’t even specify the existence of a call stack (a compiler is free to allocate call frames on the heap, for example)