Skip to content

Wdocumentation-pedantic fails to handle \n newline in a description #55319

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

Closed
RKSimon opened this issue May 7, 2022 · 4 comments
Closed

Wdocumentation-pedantic fails to handle \n newline in a description #55319

RKSimon opened this issue May 7, 2022 · 4 comments
Assignees
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Comments

@RKSimon
Copy link
Collaborator

RKSimon commented May 7, 2022

https://clang.godbolt.org/z/fqncE8MT6

We can use <br> to start a newline in a description, but \n gives a warning:

/// Test function
/// \returns Value<br>
///          second line
int foo();

/// Another test function
/// \returns Value\n
///          second line
int bar();
 warning: unknown command tag name [-Wdocumentation-unknown-command]
/// \returns Value\n

CC'ing @aaronpuchert as this will hopefully just be a minor extension to https://reviews.llvm.org/D111190

@RKSimon RKSimon added the clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer label May 7, 2022
@aaronpuchert
Copy link
Member

We don't have the concept of a zero-argument command yet, but I guess it would be easy to introduce. There are other commands that take no argument but that I treated as VerbatimLineCommand because they're typically on a line of their own (like \private).

RKSimon added a commit that referenced this issue May 8, 2022
First part of Issue #35297 - we want to enable Wdocumentation-pedantic as well, but need '\n' support first which Issue #55319 is addressing
@RKSimon
Copy link
Collaborator Author

RKSimon commented May 8, 2022

Thanks @aaronpuchert - this is the only remaining blocker for #35297 - unfortunately we can't easily replace \n with <br> in the code snippets included in the headers without causing issues downstream

@aaronpuchert aaronpuchert self-assigned this May 8, 2022
@aaronpuchert
Copy link
Member

I'll have a look. We actually have a couple of \n in our code base as well, and it should be low-hanging fruit.

@RKSimon
Copy link
Collaborator Author

RKSimon commented May 13, 2022

Thanks for the fast turnaround @aaronpuchert !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Projects
None yet
Development

No branches or pull requests

2 participants