[libcxx-commits] [PATCH] D134598: [libc++] Fix availability markup for std::format

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 16 13:53:54 PDT 2023


ldionne added inline comments.


================
Comment at: libcxx/include/__chrono/formatter.h:50
 #  pragma GCC system_header
 #endif
 
----------------
Most of these changes are removals. The interesting change to see is actually where the annotations were kept, but this diff doesn't show it. As a summary, only the following entities still have the attribute after this change:

```
operator<<(chrono types) // those use std::format
std::format, std::vformat and everything else in format_functions.h // those use floating-point to_chars indirectly sometimes
formatter<floating-point> in formatter_floating_point.h // those are the only ones that use to_chars directly
```

All the other `_LIBCPP_AVAILABILITY_FORMAT` are gone cause they don't use to_chars.



================
Comment at: libcxx/include/__format/format_functions.h:441
 
+template <class = void> // This needs to be a template for availability markup not to fire too eagerly
 _LIBCPP_ALWAYS_INLINE inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_FORMAT string
----------------
I want to call this out -- this is terrible but omitting this creates huge problems with the attribute. I am not convinced this is acceptable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134598/new/

https://reviews.llvm.org/D134598



More information about the libcxx-commits mailing list