GNOME Bugzilla – Bug 306076
examples with "using namespace" not hyperlinked properly
Last modified: 2012-11-18 11:11:28 UTC
Please describe the problem: Example code that contains the "using namespace xyz" line do not properly generated hyperlinks to classes in that namespace. Also, statements involving member functions and the pointer operator do not get hyperlinked properly. Steps to reproduce: 1. Untar doxygen.examples_namespace_bug.tgz 2. run doxygen in the top-level directory 3. look at examples/torus.cpp - the comments in the code point out what does and does not get linked Actual results: Several of the references to member functions in main/torus.cpp do not have hyperlinks. Expected results: All the references to member functions in main/torus.cpp should have hyperlinks. Does this happen every time? yes Other information: yes
Created attachment 47077 [details] test case that shows failure of examples and namespaces
Created attachment 47078 [details] test case that shows failure of examples
Created attachment 47079 [details] test case that shows failure
When I try to download the attachment, Mozilla insists on calling it attachment.cgi, but it is in fact a tgz file containing the test case.
Confirmed (though your example has a typo. The variable name is declared as bSplineSurface, but bsplineSurface is used. Note the casing!). Should be fixed in the next CVS update/release.
Doh - sorry about the misspelled words. I downloaded doxygen-1.4.4-20050808, and that did not seem to fix the problem.
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.
Tested in 1.4.5 and verified that it works.
Created attachment 54157 [details] sample showing failure of using namespace with examples This is the sample that shows that the fix for this bug was not complete. The attachment is a .tgz file. Run doxygen at the top level directory and look at the examples/torus.cpp page under Examples. Here is the problem - methods and variables that are part of a namespace do not get hyperlinked under the following conditions: 1> "using namespace XYZ" is used at the top of the example code 2> The reference does not use the "XYZ::" prefix 3> The reference contains an imbedded ::, as in the invocation of a static method
I am reopening this bug because it was only partially fixed - the comments with the attachment explain the remaining problem.
I recently tested this with 1.5.3 and 1.6.3 and this still does not work. I would really like to see this fixed, as this causes many many problems for my generated documentation.
Confirmed. 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.0. 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.
Although it works much better than before, this is still not fixed. The sample that was originally attached is fixed by 1.7.1, but a slightly modified version of the sample fails. The difference that causes failure is the addition of a local class declaration and definition, and this breaks the hyperlinking of static methods in combination with "using namespace xxx."
Created attachment 166320 [details] revised sample that breaks hyperlinking of examples with "using namespace"
1. Untar the latest attachment 2 [details]. run doxygen in the top-level directory 3. look at examples/torus.cpp - the comments in the code point out what does and does not get linked
Confirmed. The MyBSplineSurface constructor definition causes the scope to be reset. Should be fixed in the next subversion update.
Created attachment 169013 [details] small example for missing links with namespaces
I have similar problems with creating links. In the attachment: links are fine for the class 'ok' but no links for the class 'not_ok'.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.2. 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.
The last attachments still does not work with 1.7.2. It is a case with 'using namespace and \code
Created attachment 174132 [details] Another example of missing links to namespace members The problem described in this bug report is not limited to the "using" keyword. Also when comments are located within the namespace { ... } not always the proper links are being generated. For the attached example with Doxygen 1.7.2: Member MyGlobalFunc1 (MyGlobalType a,MyGlobalType b) - In the detailed description Doxygen should create a link for MyGlobalType (i.e. the one without double colon prefix). - In the bug list Doxygen should create a link to MyGlobalType for parameter a. Member PLAT::MyNSFunc1 (PLAT::MyNSType a, MyNSType b,MyNSType c) - In the function overview of the namespace page, Doxygen should not create a link from the type of parameter c to PLAT::MyNSType. - In the detailed description of the namespace page, Doxygen should create a link to PLAT::MyNSType for parameter b. - In the function overview of the file reference page, Doxygen should create a link to PLAT::MyNSType for parameter b. - In the bug list, Doxygen should create a link to PLAT::MyNSType for parameter b.
(In reply to comment #21) > The last attachments still does not work with 1.7.2. It is a case with 'using > namespace and \code You are right, there was still an explicit check for an example block in the code. I'll correct this in the next subversion update. (In reply to comment #22) This is really a different issue. Doxygen does not autolink normal words (without # or ::) unless they are class names. If you still think there is an issue, please file a new bug report for it.
using namespace and \code works fine for our examples with 1.7.2-20101118. Thank you! There are some other issues regarding non-empty-constructors and member function linking. But they are not releated to this topic and I will check first at the mailing list ... (In reply to comment #21) > The last attachments still does not work with 1.7.2. It is a case with 'using > namespace and \code
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.