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

Fix compilation on gcc-4.1 #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ProgramFan
Copy link

Some old but long-lasting system (like those installed on supercomputers) use pretty old compilers. So make backward work on gcc-4.1 is useful. This PR fixes it. It is tested on docker uilianries/conangcc41 and both the compilation and the stacktrace printing works.

@@ -1590,7 +1590,7 @@ class SourceFile {
swap(from); return *this;
}
#else
explicit SourceFile(const SourceFile& from) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good idea. It will allow implicit move semantic. Which is going to corrupt the from argument silently. Forcing it explicit ensures that you somewhat know what you are doing. A solution is maybe to make both the move constructor and the poor's man move constructor private. And then write move methods wrapping them. Which is by definition explicit to call.

move(const SourceFiles* from) on <C++11

and for >=C++11

move(SourceFile&& from)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am taking the suggestion.

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 this pull request may close these issues.

None yet

2 participants