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

Compilation Error: Invalid Use of 'this' at Top Level in range.hxx (libpqxx 7.8.0, openSUSE Leap 15.5) #737

Closed
lenin41211 opened this issue Oct 10, 2023 · 4 comments

Comments

@lenin41211
Copy link

lenin41211 commented Oct 10, 2023

I'm encountering an issue while attempting to install libpqxx 7.8.0 on openSUSE Leap 15.5. I've configured it using ./configure CXXFLAGS="-std=c++17". However, during the compilation, I'm facing errors related to invalid use of 'this' at the top level in the range.hxx file. The specific lines causing trouble are related to comparisons and noexcept specifications.

Here's a snippet of the errors:
../include/pqxx/range.hxx:143:24: error: invalid use of ‘this’ at top level
noexcept(noexcept(*this->value() == *rhs.value()))
^~~~
...
../include/pqxx/range.hxx:315:25: error: invalid use of ‘this’ at top level
noexcept(noexcept((*this & other) == other))

These errors seem to be pointing to improper usage of 'this' in the range.hxx file, please assist me resolve this...

@tt4g
Copy link
Contributor

tt4g commented Oct 10, 2023

This appears to be a bug that has been reproduced many times in GCC.
Try updating your compiler.

@jtv
Copy link
Owner

jtv commented Oct 11, 2023

For the record @lenin41211, what compiler & version are you using? I don't track it very closely but the known minimum gcc version that'll work is 8.

@lenin41211
Copy link
Author

I switched from using gcc-11 to gcc-13, and the upgrade has resolved the issue, ensuring smooth functionality, thank you.

@jtv
Copy link
Owner

jtv commented Oct 15, 2023

Glad that's solved! I'll close the ticket.

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

3 participants