[cfe-dev] -fsanitize=enum false positive with ˜ios::failbit ?

Joe Groff arcata at gmail.com
Thu Feb 28 12:33:56 PST 2013

On Thu, Feb 28, 2013 at 11:36 AM, Sean McBride <sean at rogue-research.com>wrote:

> The C++03 standard does "~ios::failbit" in, which suggests
> it's valid and clang is wrong.
> Is this a false positive?

I don't think so. Enum values are only defined for the number of bits
needed to represent the type's member values, so if 'x' is a defined
iostate value, then 'x & ~ios::failbit' results in a valid iostate value,
but ~ios::failbit is not itself a valid iostate value.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130228/08f15561/attachment.html>

More information about the cfe-dev mailing list