[c++] fix c++11-narrowing when compiling with clang