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

C++20 compilation failed because of PQXX_UNLIKELY #475

Closed
TmLev opened this issue Aug 17, 2021 · 5 comments · Fixed by #476
Closed

C++20 compilation failed because of PQXX_UNLIKELY #475

TmLev opened this issue Aug 17, 2021 · 5 comments · Fixed by #476

Comments

@TmLev
Copy link
Contributor

TmLev commented Aug 17, 2021

Error message from clang++-12:

error: no return statement in constexpr function
constexpr tx_stat parse_status(std::string_view text) noexcept

Removing this line just before the return statement seems to fix the issue.

@jtv
Copy link
Owner

jtv commented Aug 17, 2021 via email

@TmLev
Copy link
Contributor Author

TmLev commented Aug 17, 2021

@jtv compiler and its error are mentioned in OP of the GitHub issue: #475 (comment)
As well as the pull request that can fix it: #476

@jtv
Copy link
Owner

jtv commented Aug 17, 2021

Ah, OK, sorry. Read the report on a telephone while dealing with other stuff, so I missed some things. When I try it here (also with clang 12) I get a whole bunch of these warnings. I'll remove those attributes.

@jtv jtv closed this as completed in #476 Aug 17, 2021
jtv added a commit that referenced this issue Aug 17, 2021
With clang 12 I get a lot more warnings (or errors, in maintainer mode)
about `[[likely]]` or `[[unlikely]]` in `if constexpr`.  Remove those
attributes.
@jtv
Copy link
Owner

jtv commented Aug 17, 2021

@TmLev wow, this is surprising: I just saw the Github email again, and it completely left out the part about the compiler! And it showed only part of the error message, so I didn't recognise it as such.

What I got was:

Error message:

constexpr tx_stat parse_status(std::string_view text) noexcept```

Removing [this line just before return]
(https://github.com/<etc>) seems to fix the issue.

Lesson learned: cant trust the emails...

@TmLev
Copy link
Contributor Author

TmLev commented Aug 18, 2021

@jtv To be fair, I edited OP a bit after opening the issue, so no wonder email didn't catch all of it.

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

Successfully merging a pull request may close this issue.

2 participants