Open AlCash07 opened 7 years ago
You should probably clarify exact scenarios when it happens. Doxygen or, with -fparse-all-comments
, 'almost Doxygen' comments attached to unused declarations definitely get removed. I know that trailing comments don't. Anything else?
In the following example both comments aren't removed without -fparse-all-comments
, and with this option the one inside class is removed: http://ideone.com/BSoOtw. Looks like, standalone comments are always ignored.
The first comment is removed with -fparse-all-comments
or if it is changed to doxygen style, as expected. The second comment is not removed because it is attached to a used function.
I think it would make sense to attach a comment to a function only if there are no empty lines between them.
I believe that's how Doxygen and, by extension, clang parser works. Could probably be hacked around but I don't think it's worth it.
Comments in global namespace aren't removed, and I didn't find an option to change this behavior. Comments inside classes that are at least partially inlined are also affected.