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

compile error with gcc 5.3.1 #1262

Closed
DanielMues opened this issue Jan 11, 2024 · 6 comments
Closed

compile error with gcc 5.3.1 #1262

DanielMues opened this issue Jan 11, 2024 · 6 comments

Comments

@DanielMues
Copy link

with this function:
image
I get this error:
[build] ls_charges.cpp:89:44: required from here
[build] build/_deps/sqlite_orm-src/include/sqlite_orm/sqlite_orm.h:19421:96: error: binding 'const string {aka const std::__cxx11::basic_string}' to reference of type 'std::__cxx11::basic_string&' discards qualifiers
[build] table.for_each_column([this, colInfo, &tableName = table.name, db](auto& column) {

in the library header itself it marks the db paramenter:
image

environment:
compiler: gcc 5.3.1 arm-linux
c++ 14

for development I compile with gcc 10, there is no such error

is there anything known about this, or do you have an idea what it could be?

@fnc12
Copy link
Owner

fnc12 commented Jan 11, 2024

it looks like a compiler bug. I bet clang also will compile it with no errors. Your compiler (gcc 5.3.1) is sure that capture &tableName = table.name has to be non const ref but actually it has to be const ref cause table is const value. GCC 10 knows it. Try updating your compiler.

@trueqbit
Copy link
Collaborator

See #1157 and #1145

@DanielMues
Copy link
Author

okay, I will check if an update of the compiler is possible. A workaround is probably not known, or?

@trueqbit
Copy link
Collaborator

okay, I will check if an update of the compiler is possible. A workaround is probably not known, or?

Which workaround do you suggest?

@DanielMues
Copy link
Author

Was just curious if you know one, I don´t have one/did not find one.

@trueqbit
Copy link
Collaborator

@DanielMues I don't know of any workaround, you'd have to try one and let us know...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants