GNOME Bugzilla – Bug 634775
C++ // style comments that start a line in \code section doesn't work
Last modified: 2011-01-03 19:01:39 UTC
\code // This is a comment for my code. struct bla { int val; } \endcode The above would delete // and treat the rest of the line as code with syntax highlighting. The word 'for' would be a different color because it is a reserved word. Spaces and tabs beforehand don't change anything. The // still gets deleted. Note that a comment after existing code on the same line is fine. \code int val; // My value \endcode This works fine.
Hi Cleo, I tried to reproduce with this minimal example: --------------------------------------- /** Look at this code fragment: \code // This is a comment for my code. struct bla { int val; } \endcode */ class Test { }; --------------------------------------- and a default config file, but it work fine. Can you please attach a self-contained example (source+config file in a tar or zip) that allows me to reproduce the problem?
I've traced the problem to an inner class. Here is the example I have. Just save it, update the filename at the top and use default settings. I can send a zip if this doesn't work. ------------------------ /*! \file CSIndexedSkipList.h */ class bla { //! Used to initialize probability in list constructor. struct Prob { double probability; //!< Probability that node will have another level. size_type maxLevel; //!< Maximum number of levels allowed. //! Set probability to 0.25 and calculate maxLevel based on maxNodes. Prob(size_type maxNodes) {} //! Set probability and maximum number of levels directly. Prob(double probability, size_type maxLevel) {} }; }; /*! \mainpage \code // This is not ok class blorg { int val; // This is ok }; \endcode */ -------------------------------- That's it. BTW, if I put the class after the mainpage section (it can be any page), the comments show up correctly. I have a rather large project and even if I do this, the comments still don't show up. I can say that this problem spans files. I'm guessing that as soon as it reads that class in, the problem persists throughout the project. I have other inner classes elsewhere that may cause the same problem. What's REALLY weird is that if I remove the following line, the problem goes away. //! Set probability to 0.25 and calculate maxLevel based on maxNodes.
I've found the problem. It was quite subtle indeed. It should be fixed in the next subversion update.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.3. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.