Backport llvm 3.5 and gcc 4.9.1 compatibility

Same as the other pr but this time for release 1.5.