[clang-doc] Comments in macros don't appear in the generated docs · Issue #59819 · llvm/llvm-project (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Make a class, declare some of its methods in a macro, with /* comments */ on them. They don't appear in the docs.
An example in action: https://danakj.github.io/subspace-docs/sus/num/i32.html
struct i32 final { _sus__signed_impl(i32, /PrimitiveT=/int32_t, /UnsignedT=/u32); };
In _sus__signed_impl
:
#define _sus__signed_log(T)
/** Returns the base 2 logarithm of the number, rounded down. \
\
- Returns None if the number is negative or zero.
*/ \
constexpr Option checked_log2() const& {
if (primitive_value <= 0) [[unlikely]] {
return Option::none();
} else {
uint32_t zeros = __private::leading_zeros_nonzero(
::sus:📑:unsafe_fn,
__private::into_unsigned(primitive_value));
return Option::some(BITS - 1_u32 - u32(zeros));
}
}
The docs:
checked_log2
public [Option](https://danakj.github.io/subspace-docs/sus/option/Option.html) checked_log2()
Defined at line [37](https://github.com/chromium/subspace/blob/main/subspace/num/signed_integer.h#37) of file [signed_integer.h](https://github.com/chromium/subspace/blob/main/subspace/num/signed_integer.h)