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

Boolean expression as template argument confuses doxygen (Origin: bugzilla #145294) #1169

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

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 1, 2018

status RESOLVED severity major in component general for ---
Reported in version 1.3.x on platform Other
Assigned to: Dimitri van Heesch

Original attachment names and IDs:

On 2004-07-02 07:39:39 +0000, Wu Yongwei wrote:

Try running doxygen on the following C++ file:


/** Test Class 1. /
template <class _Host, bool _RealLock>
class_level_lock {
public:
/
* Lock. /
void lock();
/
* Unlock. */
void unlock();
};

/** Test Class 2. /
template
class Client : public class_level_lock<Client, (_ClientId < 0)> {
public:
/
* A test member function. */
void test();
};

No class documentation will be generated at all. Changing "(_ClientId < 0)" to
something like "true" will make something appear, but still not quite right.
Something non-existent like "Client<Client, true>" appears in the inheritance
diagram. Not only inheritance, but also just using "class_level_lock<Client,
(_ClientId < 0)>" will cause miscellaneous problems.

On 2004-07-11 13:57:29 +0000, Dimitri van Heesch wrote:

This is a known issue. At several places in the code it is assumed that in the
argument list of a template the number of <'s and >'s matches. I've tried to
fixed this before, but it is not easy at all. As a workaround you could use:


/** Test Class 1. /
template <template class _Host, bool _RealLock>
class class_level_lock {
public:
/
* Lock. /
void lock();
/
* Unlock. */
void unlock();
};

#define IS_REAL_LOCK(id) (id<0)

/** Test Class 2. /
template
class Client : public class_level_lock<Client, IS_REAL_LOCK(_ClientId)> {
public:
/
* A test member function. */
void test();
};

Note that I also had to adjust the first template argument of the lock before my
compiler (gcc 3.3) would accept it as valid C++!

On 2004-07-12 02:31:46 +0000, Wu Yongwei wrote:

Sorry that I did not make it right when adapting the test case. In fact, apart
from the omission of keywork `class' on l. 3, l. 13 is intended to be

class Client : public class_level_lock<Client<_ClientId>, (_ClientId < 0)> {

My fault not having tested it.

On 2005-10-04 18:39:19 +0000, Dimitri van Heesch wrote:

This bug was resolved to status "FIXED" as part of a group change. Please verify
that this bug is indeed fixed in doxygen version 1.4.5 (or later). If not then
please reopen the bug, so it stays on my radar.

On 2005-10-08 08:09:41 +0000, Wu Yongwei wrote:

Really fixed in 1.4.5? My test with doxygen-1.4.5.windows.bin.zip did not show
so. I use the same old test file:

/**

/** Test Class 1. /
template <class _Host, bool _RealLock>
class class_level_lock {
public:
/
* Lock. /
void lock();
/
* Unlock. */
void unlock();
};

/** Test Class 2. /
template
class Client : public class_level_lock<Client<_ClientId>, (_ClientId < 0)> {
public:
/
* A test member function. */
void test();
};

No diagrams are output, until I change "(_ClientId < 0)" to something
like "(_ClientId != 0)" or "true", i.e., remove the less-than or greater-than
character.

On 2005-10-08 15:32:41 +0000, Dimitri van Heesch wrote:

I assumed it was fixed since the status was "assigned". You are right that it is
not. I have a fix now, so it should appear in the next CVS update.

On 2005-12-30 17:47:36 +0000, Dimitri van Heesch wrote:

This bug had the status ASSIGNED (which meant it was fixed, but not officially released), so now doxygen release 1.4.6 is out I've given it the status FIXED.

Nevertheless, I would like to ask you to verify that this bug is indeed fixed in release 1.4.6. If not, then please reopen the bug.

On 2006-04-17 12:45:27 +0000, Wu Yongwei wrote:

Hi Dimitri,

I just tested it and regretted to inform you that the bug is still there.

Since I changed job, I cannot access my old e-mail address and it seems I cannot change the status of the bug now.

On 2006-04-17 19:06:42 +0000, Dimitri van Heesch wrote:

Reopen, as per request of the submitter.

On 2007-07-30 15:42:14 +0000, zaffanella@cs.unipr.it wrote:

Please find attached a simple test showing what seems to be a variant of the bug described here above.

The test uses several Boolean operators in expressions occurring in template parameter lists (which is often the case when using template meta-programming techniques): besides the case of relational operators < and > being (mis-) interpreted as unbalanced angled parentheses, it shows a problem with the use of balanced (round, i.e., not angled) parentheses.

On 2007-07-30 15:43:49 +0000, zaffanella@cs.unipr.it wrote:

Created attachment 92720
other variations for what seems to be the same bug

On 2013-04-28 09:10:58 +0000, albert wrote:

I've tested the problem from Wu Yongwei with version 1.4.5 and with version 1.8.3.1 and with version 1.4.5 I don't see any graphs in "Client< _ClientId > Class Template Reference" whilst these are present in version 1.8.3.1

In respect to the problem as mentioned by zaffanella, the ko2 variable still does not show up, so this bug is still present, I don't see any error message regarding it though.

On 2013-05-10 13:51:48 +0000, Dimitri van Heesch wrote:

Confirmed. The problem with ko2 should be fixed in the next subversion update.

On 2013-05-19 12:36:32 +0000, Dimitri van Heesch wrote:

This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.4. 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 1, 2018

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