Disallow implicit conversions from None to integer types
authorJustin Bogner <mail@justinbogner.com>
Fri, 20 Feb 2015 07:28:28 +0000 (07:28 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 20 Feb 2015 07:28:28 +0000 (07:28 +0000)
commita074de6ff45f6d0332e5ee61743daee59be444d2
tree034b9e1316c0e4bbfc723a7eea557baa55198207
parent0ba76cd459cc09c5f2f417dd527ef70c11abf857
Disallow implicit conversions from None to integer types

This fixes an error introduced in r228934 where None was converted to
an int instead of the int being converted to an Optional as intended.
We make that sort of mistake a compile error by changing NoneType into
a scoped enum.

Finally, provide a static NoneType called None to avoid forcing all
users to spell it NoneType::None.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229980 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/None.h
lib/ProfileData/CoverageMapping.cpp