brevzin / cpp_proposals

My WG21 proposals
35 stars 22 forks source link

P2758 Emitting messages at compile time #58

Closed brevzin closed 1 month ago

brevzin commented 1 year ago

P2758R0 - Emitting messages at compile time.

https://github.com/cplusplus/papers/issues/1445

frederick-vs-ja commented 8 months ago

It seems that constexpr_error_str shouldn't be a constexpr function as it unconditionally causes contant evaluation failure.

Edit: oh, I guess the intent is allowing constant expression evaluator to enter the function body and execute some builtin...

brevzin commented 8 months ago

It seems that constexpr_error_str shouldn't be a constexpr function as it unconditionally causes contant evaluation failure.

Edit: oh, I guess the intent is allowing constant expression evaluator to enter the function body and execute some builtin...

Yeah I need it to be ill-formed because the call emits a diagnostic and fails, not ill-formed because we just called some non-constexpr function - otherwise I wouldn't get the diagnostic I need.