Mohammad Nejati

Results 144 comments of Mohammad Nejati

Does this happen only in your code, or can you reproduce it using the existing examples?

@voidiii, Any update on this? What's your platform? Could you provide a minimal reproducible example?

@hzeller, I'm using clangd-20 and clang-tidy-20 with the `-misc-include-cleaner` check, but I wasn't able to reproduce the warning you mentioned. Could you please provide more details on how to reproduce...

I believe functions that take `error_code& ec` are not supposed to clear it unless they internally need to rely on it (for example, by calling another function and checking `ec`)....

> This propagates up to higher level calls like file.open(path, ec) where the behavior was unexpected (to me). Which file API are you using? The `file_win32::open` function clears the `error_code`...

Yes, it’s possible. You can use [`http::async_read_header`](https://www.boost.org/doc/libs/develop/libs/beast/doc/html/beast/ref/boost__beast__http__async_read_header.html) and [`http::async_read_some`](https://www.boost.org/doc/libs/develop/libs/beast/doc/html/beast/ref/boost__beast__http__async_read_some.html) to take control of the read loop. However, Beast doesn't provide built-in support for EventSource. it's up to you to parse...

Related, https://github.com/boostorg/beast/issues/2987

Please review all file-related operations to ensure they clear `ec` on success, and also determine how we can add appropriate tests to confirm this.

In Clang 3.7 and 3.8, the warning appears even without the `-Wpedantic` flag: https://godbolt.org/z/sf8GP4s6q https://godbolt.org/z/P9YWddbsa

Could you please provide a minimal reproducible example that shows the issue?