https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124149

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Boris Staletic from comment #1)
> The error you got from gcc is very misleading, but the actual problem is
> that you can't use string literals like that.
> 
> The values of annotations need to be usable as constant template arguments:
> https://eel.is/c++draft/dcl.attr.annotation#2
> https://eel.is/c++draft/meta.reflection.result#1
> https://eel.is/c++draft/temp.param#12
> 
> String literals do not qualify. What you can do is:

As per [temp.arg.nontype].

> - Replace `const char*` with some sort of fixed_string type that is
> structural
> - Or use std::define_static_string("literal")

Thanks for the comment.

Closing.

Reply via email to