Improve handling of gmock and gcc6