The mangling is broken when using `-cxx-abi microsoft`: $ cat const_arrays.cpp extern const char* const* global; // CHECK: "\01?global@@3PBQBDB" // NOW: "\01?global@@3PQBDA" // Probably related to PR13182 void foo(const char* const* arg) { // CHECK: "\01?foo@@YAXPBQBD@Z" // NOW: "\01?foo@@YAXPQBD@Z" // Probably UN-related to PR13182 if (global[0]) arg++; }
Are you working on this Timur?
Not yet. This affects only one file of my current 500+-files target :) Feel free to take over if you want.
If you do take over - please pay more attention to the `foo` mangling as half of the `global` mangling problem will be solved by my PR13182 patch
One more possibly related test: void foo(const unsigned int) {} // CHECK: "\01?foo@@YAXI@Z" // NOW: "\01?foo@@YAXBI@Z"
More tests: void foo(const double) {} // CHECK: "\01?foo@@YAXN@Z" // NOW: "\01?foo@@YAXBN@Z" typedef double Vector[3]; void foo(const Vector) {} // CHECK: "\01?foo@@YAXQBN@Z" // NOW: "\01?foo@@YAXBQAN@Z" void foo(Vector*, const Vector, const double) {} // CHECK: "\01?foo@@YAXPAY02NQBNN@Z" // NOW: "\01?foo@@YAXPAY02NBQANBN@Z" void foo(Vector*) {} // CHECK: "\01?foo@@YAXPAY02N@Z" // NOW: "\01?foo@@YAXPAY02N@Z" // The last one is correct now
Taking this
Good news: I think I've fixed all these issues. I'll need to clean up the code (comments, mostly) before sending it for a review though.
Thanks for the update. I'll be happy to help review the patch once you post it.
Should be fixed by r163110.
... and added more tests in r163111.