[cfe-dev] Attaching documentation comments to macros

Kevin Funk kfunk at kde.org
Fri Aug 8 16:11:41 PDT 2014


Another question: Has there be any work going on regarding attaching doxygen-
style comments to macros as well? Right now, that (still) doesn't work.

I've noticed that this was part of the "Future work" section as in [1].

/// Foo
#define FOO 1

/// Bar
int BAR = 1;

$ clang++ -cc1 -ast-dump test.cpp
`-VarDecl 0x300d420 </home/krf/devel/src/playground/qmainwindow-cmake-
template/src/mainwindow.cpp:5:1, col:11> BAR 'int'
  |-IntegerLiteral 0x300d478 <col:11> 'int' 1
  `-FullComment 0x300d540 <line:4:4, col:7>
    `-ParagraphComment 0x300d510 <col:4, col:7>
      `-TextComment 0x300d4e0 <col:4, col:7> Text=" Bar"

=> Right now just generates a "FullComment" decl for BAR. But it should also 
do that for "FOO".

Would be nice to get this feature in Clang!


[1] llvm.org/devmtg/2012-11/Gribenko_CommentParsing.pdf

Kevin Funk | kfunk at kde.org | http://kfunk.org

More information about the cfe-dev mailing list