welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
diag.hpp File Reference

welder's consteval diagnostics, collected in one place: every hand-rolled compile-time error the library raises beyond a static_assert is one of the exception types below, thrown during constant evaluation (a C++26 constexpr exception). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  welder::diag::lang_out_of_mask_range
 Thrown by lang_bit (<welder/annotations.hpp>) when a lang value lies past the 32-bit language-mask width — instead of an opaque shift-overflow error. More...
struct  welder::diag::dangling_return_policy
 Thrown by validate_return_policy (<welder/reflect.hpp>) — every rod runs it at its per-overload bind site — when a reference-category return_policy meets a by-value return. More...
struct  welder::diag::bare_mark_only
 Thrown by member_bound (<welder/reflect.hpp>) when a member carries a bare [[=welder::mark::only]] — "only, for every language" restricts nothing, so the mark must be called. More...
struct  welder::diag::no_matching_virtual_slot
 Thrown by virtual_slot (<welder/rods/python/trampoline.hpp>, reached through WELDER_PY_OVERRIDE_AS) when no overridable virtual of the class matches the requested name and function type. More...
struct  welder::diag::stale_hook_signature
 Thrown by member_access_admitted (<welder/bind_traits.hpp>) when a resolution still declares its optional protected_participates hook under the superseded two-argument signature — which would otherwise be silently ignored (the detection is a requires probe). More...

Namespaces

namespace  welder
namespace  welder::diag

Detailed Description

welder's consteval diagnostics, collected in one place: every hand-rolled compile-time error the library raises beyond a static_assert is one of the exception types below, thrown during constant evaluation (a C++26 constexpr exception).

An uncaught constexpr exception renders the program ill-formed with the exception's type and the carried what prose verbatim in the compiler's uncaught exception '…' diagnostic — one error, a greppable type name, and a real punctuation-and-spaces message, where the older undefined-function-anchor idiom produced two errors with the message crammed into an identifier.

Each type carries its canonical message as a default member initializer, so a raise site is just throw diag::bare_mark_only{}; — the message has a single source of truth here.

Like the vocabulary headers (lang.hpp, annotations.hpp), this header is std-include-free — the messages are plain const char*, core language only — so the vocabulary may include it and a future import welder; module wrapper can re-export it without leaking std into importers.

Definition in file diag.hpp.