[Lldb-commits] [clang] [clang-tools-extra] [lldb] [llvm] Add test to clang-doc, it can test comments in macro. Original issue is #59819. (PR #132360)

Paul Kirth via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 21 08:59:02 PDT 2025


================
@@ -0,0 +1,32 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %s
+// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s
+// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MyClass-LINE
+// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MyClass
+// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MyClass-LINE
+// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MyClass
+
+#define DECLARE_METHODS                                           \
+    /**    
+     * @brief Declare a method to calculate the sum of two numbers
----------------
ilovepi wrote:

I don't think this comment is in the macro, did you intend it to be?

Also as I understand it the bug wasn't filed about comments within macros, which I seldom see. But about comments attached to macros. 

I'd also suggest a simpler macro that doesn't define a full function (which also doesn't appear to actually be part of the macro.). 

Maybe the macro could be something like
```c++
/// Your doc comments 
#define ADD(a, b) a+b
```

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


More information about the lldb-commits mailing list