[clang-tools-extra] [clang-doc] add support for enums comments in html generation (PR #101282)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 9 15:50:28 PDT 2024
================
@@ -653,15 +697,35 @@ static std::vector<std::unique_ptr<TagNode>>
genHTML(const EnumInfo &I, const ClangDocContext &CDCtx) {
std::vector<std::unique_ptr<TagNode>> Out;
std::string EnumType = I.Scoped ? "enum class " : "enum ";
+ // Determine if enum members have comments attached
+ bool HasComments = false;
+ for (const auto &M : I.Members) {
+ if (!M.Description.empty()) {
+ HasComments = true;
+ break;
+ }
+ }
----------------
ilovepi wrote:
```suggestion
bool HasComments = std::any_of(I.Members.begin(), I.Members.end(), [](auto M){return M.Description.empty();});
```
Maybe something like this instead? I didn't check the syntax, so take w/ a grain of salt.
https://github.com/llvm/llvm-project/pull/101282
More information about the cfe-commits
mailing list