After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740218 - Full scope needed when making link inside cross-referenced section [with test case]
Full scope needed when making link inside cross-referenced section [with test...
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.8-GIT
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on: 729063
Blocks:
 
 
Reported: 2014-11-16 19:51 UTC by Vladimír Vondruš
Modified: 2014-12-25 16:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Repro/test case (433 bytes, application/zip)
2014-11-16 19:51 UTC, Vladimír Vondruš
Details
HTML Page of Deprecated List (4.41 KB, text/html)
2014-11-16 20:23 UTC, Kevin McBride
Details
Edited Test Case (478 bytes, application/x-zip-compressed)
2014-11-16 20:52 UTC, Kevin McBride
Details
Repro/test case for the regression (425 bytes, application/zip)
2014-12-18 18:44 UTC, Vladimír Vondruš
Details

Description Vladimír Vondruš 2014-11-16 19:51:17 UTC
Created attachment 290809 [details]
Repro/test case

See attached ZIP file for minimal repro case or the following snippet:

    namespace Foo {

    /** @brief Structure */
    struct Bar {
        /**
         * @brief Foo
         * @deprecated Use @ref bar() instead.
         */
        void foo1();

        /**
         * @brief Foo
         * @deprecated Use @ref Foo::Bar::bar() "bar()" instead.
         */
        void foo2();

        /** @brief Bar */
        void bar();
    };

    }

WHen generating docs, Doxygen compains about invalid reference on the deprecated page:

    deprecated:2: warning: unable to resolve reference to `bar()' for \ref command

The first link is created correctly in the class documentation, but not on the Deprecated page (deprecated.html). When full scope is specified like in the second case, the link is correctly generated, but the workaround gets annoying when the scope is too long to write. This happens for all cross-referenced items, such as @todo, @bug and user-defined ones created with @xrefitem.

Would it possible for Doxygen to remember scope of each cross-referenced item when creating given page and resolve links relative to that scope?

Tested with current Git (9f477b8), but the issue appears for some time (I think
it was present already in 1.7).
Comment 1 Kevin McBride 2014-11-16 20:23:03 UTC
Created attachment 290811 [details]
HTML Page of Deprecated List
Comment 2 Kevin McBride 2014-11-16 20:47:52 UTC
I have the same problem with version 1.8.8.  In addition, a search for similar bugs reveals that Doxygen has a problem with referencing functions in structs and classes within the namespace it is documenting.

I also put some code underneath bar(), named the function foo3(), and bar() is still not being referenced in deprecated blocks.
Comment 3 Kevin McBride 2014-11-16 20:52:02 UTC
Created attachment 290814 [details]
Edited Test Case
Comment 4 Dimitri van Heesch 2014-11-17 19:44:52 UTC
Confirmed. Should be fixed in the next GIT update.
Comment 5 Vladimír Vondruš 2014-12-18 18:43:29 UTC
Sorry for taking so long to reply, but the commit (c6e41226574) caused an regression for me. The relative scope now works properly, but the output is broken in the following case (also included in the following attachment):

    namespace MyNamespace {

    template<class> struct Foo;

    /** @todo Xrefitem works without issues */
    template<class T> struct Foo<T> {};

    /** @todo Xrefitem prints warning */
    template<class T> struct Foo<Bar<T>> {};

    }

When processing the file, Doxygen prints the following output (in other words, fully-scoped name of the documented template specialization, character by character):

    todo:2: warning: Unexpected character `M'
    todo:2: warning: Unexpected character `y'
    todo:2: warning: Unexpected character `N'
    todo:2: warning: Unexpected character `a'
    todo:2: warning: Unexpected character `m'
    todo:2: warning: Unexpected character `e'
    todo:2: warning: Unexpected character `s'
    todo:2: warning: Unexpected character `p'
    todo:2: warning: Unexpected character `a'
    todo:2: warning: Unexpected character `c'
    todo:2: warning: Unexpected character `e'
    todo:2: warning: Unexpected character `:'
    todo:2: warning: Unexpected character `:'
    todo:2: warning: Unexpected character `F'
    todo:2: warning: Unexpected character `o'
    todo:2: warning: Unexpected character `o'

In addition to this warning, in the cross-reference list (in this case the TODO list), the following is displayed:

    Bar< T > > Class MyNamespace::Foo< Bar< T > >

instead of just:

    Class MyNamespace::Foo< Bar< T > >

To be clear, the issue appears only when using template as template parameter in template specialization (very corner case, I know). When using non-templated type as template parameter (the first case), it works properly. Also it doesn't matter if the class is enclosed in namespace or not.

The issue is not present in the parent commit (9f477b87fc49) and is still present in current master (b3c44e52cf7226b1). 

Thanks a lot!
Comment 6 Vladimír Vondruš 2014-12-18 18:44:18 UTC
Created attachment 292995 [details]
Repro/test case for the regression
Comment 7 Kevin McBride 2014-12-19 05:17:38 UTC
I tested attachment in comment #6 with the release version of 1.8.8 to verify the output.  The output is okay, and I turned off quiet to verify there were no warnings.  Unfortunately, I have not yet found a way to compile 1.8.8-GIT on my Windows laptop, despite a request on bug 697511 to get the necessary files to get Visual Studio to compile doxygen.
Comment 8 Dimitri van Heesch 2014-12-19 10:25:55 UTC
Regression confirmed. Should be fixed in the next GIT update.
Comment 9 Dimitri van Heesch 2014-12-25 16:03:41 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.9. 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 (preferrably in the form of a self-contained example).