adapted to clang 3.5 final