bloomberg / clang-p2996

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

Error: use of undeclared identifier 'name_of' #117

Open retroandchill opened 1 week ago

retroandchill commented 1 week ago

Describe the bug I can't use any of the name_of/display_name_of/etc. functions in compiler explorer.

To Reproduce Steps to reproduce the behavior:

  1. Go to the following example: https://godbolt.org/z/zK734b9Mo
  2. Observe that it doesn't compile

Expected behavior It should compile and should print out the names.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context I've also tried prefixing them with std::meta, with the same results.

YiRanMushroom commented 1 week ago

You need to use display_string_of instead of name_of. Some names of the meta functions changed. I recommend checking https://github.com/bloomberg/clang-p2996/blob/p2996/libcxx/include/experimental/meta for exact function signatures.