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

Incorrect/Weird display of function #4

Closed
Wmbat opened this issue Jun 25, 2021 · 5 comments
Closed

Incorrect/Weird display of function #4

Wmbat opened this issue Jun 25, 2021 · 5 comments

Comments

@Wmbat
Copy link

Wmbat commented Jun 25, 2021

When I declare a function as a return type like so

constexpr auto borrow() const& noexcept -> const value_type&;

hdoc displays it like so https://imgur.com/a/A17UJ6g

It seems to split the const& specifier on a member function and split it in 2 parts. Not sure why it happens. It's not a big bug, but i thought it was worth reporting

@hdoc
Copy link
Owner

hdoc commented Jun 25, 2021

Hello, thanks for the issue report!

I think this is purely a cosmetic bug. Declarations are broken into multiple lines by clang-format if they exceed 50 chars in length. Without this, declarations can start exceeding page width and the generated documentation looks wonky.

It occasionally produces ugly results (as your example shows), so if you have any suggestions on how to improve it or a PR I'm all ears.

@Wmbat
Copy link
Author

Wmbat commented Jun 25, 2021

Well, it does that same thing, where it removes the && or & from the const in member functions. I it does that in all the functions in my library. which could cause problems when looking at the documentation. This function

constexpr auto take() && noexcept -> value_type;

is essentially turned into this

constexpr auto take() -> reglisse::left::value_type && noexcept;

in the documentation, So, if someone looked at the docs, they'd think the function is returning an rvalue instead of only being invocable in rvalues. That && & noexept is not placed correctly and it could be problematic. As to how to fix it, i'm not sure since i'm not familiar with Clang tools and the codebase

@hdoc
Copy link
Owner

hdoc commented Jun 25, 2021

My mistake, I misinterpreted your original comment. Yes, this is a bug in how hdoc prints out function declarations. Thank you for the test case, we'll get this fixed in the next release.

@hdoc
Copy link
Owner

hdoc commented Jun 25, 2021

The fix for this is in and it should be out mid-next week. Thank you for the test cases, this was certainly worth reporting! Please let us know if you find any more bugs.

@hdoc hdoc closed this as completed Jun 25, 2021
@hdoc
Copy link
Owner

hdoc commented Jul 2, 2021

Newest release with the fix is up: https://github.com/hdoc/hdoc/releases/tag/1.2.0. Thanks again for the report.

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

2 participants