[PATCH] D22196: Fix Bug "28480 - cppcoreguidelines-pro-bounds-array-to-pointer-decay handling __PRETTY_FUNCTION__"

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 13 13:02:36 PDT 2016

aaron.ballman added a comment.

In http://reviews.llvm.org/D22196#481567, @ericLemanissier wrote:

> Well, C++ Core Guidelines advises in this case to correct function receiving __PRETTY_FUNCTION__: the parameter type should not be const char* ( https://github.com/isocpp/CppCoreGuidelines/issues/640 )
>  I'm not sure if it should be cstring_span, czstring_span, or czstring.
>  In case it is not possible to change this function, I guess the only solution is static_cast<const char*>(__PRETTY_FUNCTION)

It's not that it's not possible to change this function; I actually think the change is pretty sensible. It's mostly that we want to make sure that the check we implement matches the expected behavior of the C++ Core Guidelines. I think a good approach is to propose this patch (and the test cases) to the C++ Core Guidelines folks via their GitHub tracker, and if they agree with the behavior of your patch, then we can go ahead and add the functionality under the assumption the core guidelines will be updated accordingly as well.


More information about the cfe-commits mailing list