Is std::is_unsigned::value well defined?

There is no concept of signedness for bool. From [basic.fundamental]/6: Values of type bool are either true of false. [Note: There are no signed, unsigned, short, or long bool types or values. — end note] Values of type bool participate in integral promotions (4.5). By contrast, signedness is explicitly called out for the signed integer … Read more

Why is an if/else if/else for a simple boolean not giving an “unreachable code” error

From JLS 14.21. Unreachable Statements It is a compile-time error if a statement cannot be executed because it is unreachable. and The else-statement is reachable iff the if-then-else statement is reachable. Your if-then-else statement is reachable. So, by the definition the compiler thinks that the else-statement is reachable. Note: Interestingly the following code also compiles … Read more