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 building tests with GCC-6 #84

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

Conversation

Peter-Levine
Copy link

Building tests with GCC-6.3.0 fails with:

/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp: In member function 'bool SimpleFile::exists() const':
/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp:93:12: error: cannot convert 'std::ifstream {aka std::basic_ifstream<char>}' to 'bool' in return
     return ifile;
            ^~~~~
/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp: In static member function 'static bool SimpleFile::exists(const char*)':
/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp:100:12: error: cannot convert 'std::ifstream {aka std::basic_ifstream<char>}' to 'bool' in return
     return ifile;
            ^~~~~

Post C++11, implicit conversion to bool from an istream of ostream object is not allowed.

Modern C++ dialects require an explicit cast to bool from a stream object, instead of an implicit cast (via an implicit cast to a void *).
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.

1 participant