rnk added a comment.

That sounds reasonable to me, I confirmed that MSVC really only lets you apply 
these attributes directly to pointer types and to typedefs.

Can you add a test for the other most common type sugar node, the template 
parameter? It looks like this:

  template <typename T>
  void f(T __ptr32 a) {
      (*a) += 1;
  }
  void g(int *p) {
      f(p);
  }

If there isn't already a C++ test for __ptr32 & co, go ahead and make one.



================
Comment at: clang/lib/Sema/SemaType.cpp:7150
-  // type sugar between it and the pointer (other than attributes)? Eg, this
-  // disallows the attribute on a parenthesized pointer.
-  // And if so, should we really allow *any* type attribute?
----------------
I raised the issue because it wasn't clear if we had a definitive answer for 
the question in this FIXME.


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