bloomberg / clang-p2996

Experimental clang support for WG21 P2996 (Reflection).
https://github.com/bloomberg/clang-p2996/tree/p2996/P2996.md
51 stars 8 forks source link

`define_static_string` result cannot be used as template argument #80

Closed katzdm closed 1 month ago

katzdm commented 1 month ago

The std::meta::define_static_string uses a StringLiteral expression to construct its static storage. This is essentially a lazy approach, which has the consequence of disallowing the returned pointer from being used in a string literal (e.g., godbolt). We should instead manually allocate the result in a null-terminated character array with static storage duration.