Skip to content

Use C++20 consteval to verify translation strings #30379

@maflcko

Description

@maflcko

It is possible to write _(str_ptr), which is wrong, see #30267 (comment).

I am not familiar with the translation build system integration, but it would be good to effectively change the signature of _ from auto _(const char*) to consteval auto _(const char*).

My understanding is that this would catch this error at compile time, saving review effort and follow-up fixup changes.

Assumed compiler error message:

error: the value of 'reason' is not usable in a constant expression
      |   _(reason);
      |     ^~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions