fixed C++ compiler error reported by clang 5.1
apply workaround for clang 5.0 also to clang 5.1