C++ Logo

sg7

Advanced search

Re: [SG7] [isocpp-ext] CWG1962+CWG2362 type of __func__ / __func__ should be constexpr

From: Herring, Davis <herring_at_[hidden]>
Date: Thu, 30 Apr 2020 14:51:13 +0000
>>> 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?

Davis

Received on 2020-04-30 09:54:15