New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ // style comments that start a line in \code section doesn't work (Origin: bugzilla #634775) #4012

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.7.2 on platform Other
Assigned to: Dimitri van Heesch

On 2010-11-13 20:37:13 +0000, Cleo Saulnier wrote:

\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.

On 2010-11-14 08:39:54 +0000, Dimitri van Heesch wrote:

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?

On 2010-11-14 15:20:52 +0000, Cleo Saulnier wrote:

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.

On 2010-11-14 16:51:08 +0000, Dimitri van Heesch wrote:

I've found the problem. It was quite subtle indeed.
It should be fixed in the next subversion update.

On 2011-01-03 19:01:39 +0000, Dimitri van Heesch wrote:

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.

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment