[clang-tools-extra] [clang-doc] add enum test (PR #97679)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 07:43:23 PDT 2024


================
@@ -0,0 +1,38 @@
+// RUN: clang-doc --format=html --doxygen --output=%t/docs --executor=standalone %s
+// RUN: clang-doc --format=md --doxygen --output=%t/docs --executor=standalone %s
+// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/index.html -check-prefix=HTML-INDEX
+// RUN: FileCheck %s -input-file=%t/docs/GlobalNamespace/index.md -check-prefix=MD-INDEX
+
+/**
+ * @brief For specifying RGB colors
+ */
+enum Color {
+  Red, // Red enums
+  Green, // Green enums
+  Blue // Blue enums
----------------
ilovepi wrote:

These seem to be gone now, but isn’t it common to document the enum values? I know we do that in several places in LLVM. 

Thinking about other cases, it probably also worth having an “enum class”, an enum within a class, and one in a namespace.  I’d suggest also varying in at least one case where the doc comments are: e.g., above the value vs on the same line. 

https://github.com/llvm/llvm-project/pull/97679


More information about the cfe-commits mailing list