[Support] Avoid UB in sys::fs::perms::operator~. NFC.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 26 Apr 2017 00:48:28 +0000 (00:48 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 26 Apr 2017 00:48:28 +0000 (00:48 +0000)
commit9547aabb26148f4eb5cfa1c5ccba0fe4ab7bf4fa
tree5eff020f30c62bab80fac97a81053c87f874d14c
parentd91fb8c367186cac1b55be88314385df1959ef10
[Support] Avoid UB in sys::fs::perms::operator~. NFC.

This was exposed in r297945 and r301220: the intermediate complement
is a 32-bit value, and casting it to 'perms' invokes UB.

llvm-svn: 301373
llvm/include/llvm/Support/FileSystem.h