[PATCH] D29599: Clang Changes for alloc_align

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 19:20:34 PST 2017


ahatanak added a comment.

My question probably wasn't clear, but I wasn't sure how template functions in general (not just member functions) should be handled.

I see a warning when the following function is compiled:

  template<class T>
  T  __attribute__((alloc_align(1))) foo0(int a) {
    typedef typename std::remove_pointer<T>::type T2;
    return new T2();
  }
  
  void foo1() {
    foo0<int*>(1);
  }

clang complains that the attribute only applies to functions returning pointers or references, but foo0<int*> does return a pointer. Is that intended?


https://reviews.llvm.org/D29599





More information about the cfe-commits mailing list