Fwd: Changes to __PRETTY_FUNCTION__ in clang

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Changes to __PRETTY_FUNCTION__ in clang

Boost - Dev mailing list
Hi all,

I recently send an email to the clang mailing list, to change how clang
prints __PRETTY_FUNCTION__ [0], and one person raised a question if it
would break boost.

Honestly, I don't know boost's code and I could only find a few places
where it's used, mainly for diagnostics, but also in CTTI and hanna; that's
why I'm sending this email to ask for some help.

Does boost relies on the format of these macros? The main idea is to just
change how templates are printed, from:

X<void>::X() [T = void]

to a gcc-like style:

X<T>::X() [with T = void]

Thank you,

[0] http://lists.llvm.org/pipermail/cfe-dev/2018-February/056766.html

--

Mikhail Ramalho.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Changes to __PRETTY_FUNCTION__ in clang

Boost - Dev mailing list
On 02/05/18 18:50, Mikhail Ramalho via Boost wrote:

> Hi all,
>
> I recently send an email to the clang mailing list, to change how clang
> prints __PRETTY_FUNCTION__ [0], and one person raised a question if it
> would break boost.
>
> Honestly, I don't know boost's code and I could only find a few places
> where it's used, mainly for diagnostics, but also in CTTI and hanna; that's
> why I'm sending this email to ask for some help.
>
> Does boost relies on the format of these macros? The main idea is to just
> change how templates are printed, from:
>
> X<void>::X() [T = void]
>
> to a gcc-like style:
>
> X<T>::X() [with T = void]

__PRETTY_FUNCTION__ is used by BOOST_CURRENT_FUNCTION, which in turn may
be used by Boost.Log to generate scope names. There is a parser for
extracting function names from such generated scope names here:

https://github.com/boostorg/log/blob/develop/src/named_scope_format_parser.cpp

The parser is "best effort" and probably doesn't cover some cover cases
like lambdas, but it used to work rather well with strings generated by
gcc and MSVC. I don't think I tested it with clang, so I'm not sure how
well it works with it now or if it will be broken by the change.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost