Skip to content

[clangd] end of line /// comment on member incorrectly attached to following member #137292

Open
@RedBeard0531

Description

@RedBeard0531

For end-of-line comments like int foo; /// foo clangd will attach the comment to the next member rather than the one it shares a line with. This seems to clearly be missing the intent of the developer even if the doxygen spec says they should be using ///< foo. Any end-of-line comment always is assumed (by humans) to attach to the code is shares a line with, even if comments attach to the next thing when the whole line is a comment.

struct S {
    int foo; /// ***foo***
    int bar;
};

int x = S().bar; 

Hovering over the last bar shows the doc comment ***foo***.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"clangd

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions