This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55425] constexpr does not work in many situations (both built-in and user supplied literals)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55425

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #6 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
(In reply to Jonathan Wakely from comment #1)
> The standard says __func__ is a function-local variable, defined as if by
> 
> constexpr const char* x() {
>   static const char __func__[] = "function-name ";
>   return __func__;
> }
>  
> Clearly this is not a valid constexpr function.
> Changing this would be an extension.

I disagree with this. The standard doesn't say __func__ is only predefined if
it is used, so if this argument held then all constexpr functions would be
invalid.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]