One should not need to use -fms-extensions in order to use 32-bit pointers on 64-bit platforms.
Needs a test.
I believe these are only implemented for x86 in LLVM. What happens if you try to use this on non-x86? I wouldn't be surprised if we crash, but we should probably produce a proper error and test it.
I just tested top-of-tree clang -fms-extensions -target arm64-unknown-linux (sans this patch) and apparently the attributes are ignored, which could cause crashes at run time if a later compiler actually honors this attributes on non-x86 targets and people try to mix object files created by older and newer compilers.
I agree that the bugs you point out are worth fixing. That being said, I'm not looking to fix all of the bugs with these attributes with this patch. If it's okay, I'd like to focus on exposing the feature outside of -fms-extensions. If people want to ignore the Microsoft extension and design how this feature "should" work, that's fine too.
I'm going to abandon this change for now. The problem is that the MS extensions are not as pervasive through the language as I wanted. For example, I'd really like them to work on aggregate types. This would allow all of the pointers to said types to not need annotation, unlike the current MS model.