<div dir="ltr">I've been looking into the state of VLAs and variably-modified types in general in C++, and noticed that they actually seem quite well supported, at least for local variables. Functions with VLA parameters however are still a problem: you can define them, but you can't actually *call* them, rendering them rather useless, e.g.:<div><br></div><div>extern void foo( int m, float x[][m] );</div><div>void bar( float x[][3] ) {  foo( 3, x );  }</div><div><br></div><div>compiles in C mode but fails in C++ due to "no known conversion from 'float (*)[3]' to 'float (*)[m]' for 2nd argument".<br><div><br></div><div>I've made a feeble attempt at tracking down the root cause... I've noticed that in both cases the parameter in foo's declaration gets correctly canonicalized to float (*)[*]. However, where C happily inserts an ImplicitCastExpr 'float (*)[*]' <BitCast> into the AST for the second argument to the call to foo(), C++ is unable to do the same. At this point I got hopelessly lost: I've not been able to locate where this ImplicitCastExpr is being generated, or why it is isn't generated in C++ mode.</div></div><div><br></div><div>Intuitively I'd expect it should be relatively easy and safe to add the relevant implicit conversions to [*]-types, but I'm too unfamiliar with the clang codebase to have any idea on how to do such a thing.</div><div><br></div><div>Can anyone help here? It would be really awesome not being forced to choose between C++-without-VLA-parameters and C-with-VLA-parameters.</div><div><br></div><div>Matthijs</div></div>