Skip to content
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

Duplicate C++ declaration with nested anonymous structure #972

Open
ReenigneArcher opened this issue Feb 27, 2024 · 0 comments
Open

Duplicate C++ declaration with nested anonymous structure #972

ReenigneArcher opened this issue Feb 27, 2024 · 0 comments

Comments

@ReenigneArcher
Copy link

When an anonymous structure is nested within another structure and the same name is used in the anonymous structure a duplicate declaration warning occurs. Here's a simplified example of the code structure:

struct main_structure {
  std::string_view name;

  struct {
    std::string name;
  } a, b, c;
};

In this code, the name field is declared in both the main_structure struct and the anonymous struct inside main_structure. These are in different scopes and are not technically duplicates, but Breathe considers them as such and throws a duplicate declaration warning. These fields are in different scopes and can be accessed independently. However, Breathe doesn't seem to distinguish between these scopes when generating the documentation.

I'm looking for a way to resolve this issue. Is there a way to configure Breathe or Doxygen to handle this situation better?

Real example: https://github.com/LizardByte/Sunshine/blob/a11a795c9643003ccbdbd78eff0e4a5b779bb270/src/video.h#L85-L153

Readthedocs build: https://readthedocs.org/projects/sunshinestream/builds/23577583/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant