Boost logo

Boost :

Subject: Re: [boost] Fwd: Changes to __PRETTY_FUNCTION__ in clang
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2018-02-05 17:15:27


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk