This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
meta::exception::what() should be constevalSection: 21.4.4 [meta.reflection.exception] Status: New Submitter: Jonathan Wakely Opened: 2026-01-28 Last modified: 2026-02-13
Priority: 2
View other active issues in [meta.reflection.exception].
View all other issues in [meta.reflection.exception].
View all issues with New status.
Discussion:
As mentioned in LWG 4494(i), meta::exception::what() can be
(and should be) marked consteval now that
CWG 3117
has been approved.
[2026-02-13; Reflector poll.]
Set priority to 2 after reflector poll.
Discussion about whether this is really necessary, or redundant.
Proposed resolution:
This wording is relative to N5032.
Modify 21.4.4 [meta.reflection.exception] as indicated:
namespace std::meta { class exception : public std::exception { private: optional<string> what_; // exposition only u8string u8what_; // exposition only info from_; // exposition only source_location where_; // exposition only public: consteval exception(u8string_view what, info from, source_location where = source_location::current()) noexcept; consteval exception(string_view what, info from, source_location where = source_location::current()) noexcept; exception(const exception&) = default; exception(exception&&) = default; exception& operator=(const exception&) = default; exception& operator=(exception&&) = default;constexprconsteval const char* what() const noexcept override; consteval u8string_view u8what() const noexcept; consteval info from() const noexcept; consteval source_location where() const noexcept; }; }…
constexprconsteval const char* what() const noexcept override;-5- Constant when:
what_.has_value()istrue.