Skip to content

\ref is unable to resolve references to fields in the documented struct #11184

@arwedus

Description

@arwedus

Describe the bug
Describe what you see that (you think) is wrong.

The following code:

/// \brief Date and Time Record.
/// Represent a specific point in time.
/// \invariant \ref date and \ref day_of_the_week must not be set together.
struct DateTimeRecord
{
    /// \brief Minutes after start of the day. Valid range: 0 (00:00) to 1439 (23:59) (inclusive)
    std::optional<Int32> minutes_after_midnight;
    /// \brief This value is only set if \ref day_of_the_week has no value.
    std::optional<DateRecord> date;
    /// \brief This value is only set if \ref date has no value.
    std::optional<WeekDay> day_of_the_week;
};

results in the following doxygen warnings:

Generating Sqlite3 output for class example::sit::DateRecord
Generating Sqlite3 output for class example::sit::DateTimeRecord
/workspace/build/ref_example/example.h:55: warning: unable to resolve reference to 'date' for \ref command
/workspace/build/ref_example/example.h:55: warning: unable to resolve reference to 'day_of_the_week' for \ref command
Generating Sqlite3 output for class example::sit::TimeRestrictionRecord

NOTE: This warning is only issued when writing the Sqlite3 output.
When you set GENERATE_SQLITE3 = NO (default), the warning is not shown by doxygen build.
The references get correctly resolved in the HTML output, no matter how GENERATE_SQLITE3 is set.

NOTE: The same is true for the \copybrief or \copydetails commands:

Generating Sqlite3 output for class example::sit::DateTimeRecord
/workspace/build/ref_example/example.h:54: warning: @copydetails or @copydoc target 'minutes_after_midnight' not found
/workspace/build/ref_example/example.h:55: warning: unable to resolve reference to 'date' for \ref command
/workspace/build/ref_example/example.h:55: warning: unable to resolve reference to 'day_of_the_week' for \ref command

To Reproduce

See attached example:
ref_example.zip

Expected behavior
Describe what you would have expected or think is correct.

The warning should not be issued when GENERATE_SQLITE3 = YES

Version

doxygen: I've tested 1.10 and 1.12 (built from source)
OS: Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions