C++ Logo

SG7

Advanced search

Subject: Re: [isocpp-ext] CWG1962+CWG2362 type of __func__ / __func__ should be constexpr
From: Peter Dimov (pdimov_at_[hidden])
Date: 2020-04-30 10:22:44


Herring, Davis wrote:
> > All compilers optimize the above to just "return 'f';", so if
> > __func__[0] varies, so does the result.
>
> Sure, but what does that have to do with using that 'f' in constant
> expressions?

Nothing, of course. It only has to do with

> Perhaps an implementation might generate two different-valued weak symbols
> for "f::__func__", but so long as only one of them is used (by whichever
> weak definition of f is chosen), this seems to work correctly.


SG7 list run by herb.sutter at gmail.com

Older Archives on Google Groups