C++ Logo


Advanced search

Subject: Re: [isocpp-ext] CWG1962+CWG2362 type of __func__ / __func__ should be constexpr
From: Herring, Davis (herring_at_[hidden])
Date: 2020-04-30 09:51:13

>>> inline char f()
>>> {
>>> return __func__[0];
>>> }
> [...]
> 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?


SG7 list run by herb.sutter at gmail.com

Older Archives on Google Groups