rnk added a comment.

In D130123#3696752 <https://reviews.llvm.org/D130123#3696752>, @Ariel-Burton 
wrote:

> What is your expectation for your template code fragment?  MSVC does not 
> accept it.

Yes, I checked, MSVC rejects it, so clang should have test expectations to 
confirm that. It seems interesting or surprising, to me at least, that MSVC 
really only accepts __ptr32 on pointers and typedefs of them.

> On the other hand, MSVC does accept this:
>
>   template <typename T>
>   void f(T  a) {
>     (*a) += sizeof(a);
>   }
>   void g(int *p) {
>     f(p);
>   }
>   void h(int *__ptr32 p) {
>       f(p);
>   }

Right, this makes sense to me. MSVC's diagnostics say something about the 
__ptr32 qualifier needing to appear after a `*`, so this extension must be 
implemented at a pretty low-level, with some exception for typedefs, just like 
what you have.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130123/new/

https://reviews.llvm.org/D130123

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to