Type inference issue with clang