Oh, and no its not a bug. The compiler ( and __builtin_constant_p ) cannot guarantee 'a' is a compile time constant within its current context.
Haven't tried it but,
typedef IF< __builtin_constant_p( a ), int, long >::Result NumType;
NumType n_Number = 4;