Hi, the following bit of code: template <int N, typename T> struct Foo { typedef T __attribute__((vector_size(N*sizeof(T)))) type; }; compiles fine with gcc 4.7.2, however when compiled with clang 3.2 I get: foo.cc:4:41: error: expected ')' typedef T __attribute__((vector_size(N*sizeof(T)))) type; ^ ) foo.cc:4:41: error: expected ')' typedef T __attribute__((vector_size(N*sizeof(T)))) type; ^ ) foo.cc:4:53: error: expected member name or ';' after declaration specifiers typedef T __attribute__((vector_size(N*sizeof(T)))) type; ~~~~~~~~~ ^ Moreover even doing: template <int N, typename T> struct Foo { typedef T __attribute__((vector_size(16))) type; }; does not work and gives: foo.cc:4:28: error: invalid vector element type 'T' typedef T __attribute__((vector_size(16))) type; ^ The only way to get it to work is to eliminate the dependency on the T template argument: template <int N, typename T> struct Foo { typedef int __attribute__((vector_size(16))) type; }; compiles fine on both clang 3.2 and gcc 4.7.2 Any idea? Ciao, Giulio
I see this too under Ubuntu 14.04 with clang version 3.5.0 (trunk 210014).
I'm gonna handle this one by changing vector_size attribute to have an AST node (as aligned and align_value attributes do, for example). Alexey Frolov ============= Software Engineer Intel Compiler Team Intel
Is anyone assigned to this issue? It seems like Alexey Frolov is not working for Intel anymore, and the most recent activity was a discussion on how to resolve the issue http://lists.llvm.org/pipermail/cfe-dev/2015-June/043653.html I'm pretty sure https://bugs.llvm.org/show_bug.cgi?id=34878 is a duplicate of this issue. Best regards, Lars Bonnichsen
https://bugs.llvm.org/show_bug.cgi?id=16986 looks like another duplicate, and it seems the issue was solved in clang 9, yay. /Lars
*** Bug 16986 has been marked as a duplicate of this bug. ***
*** Bug 34878 has been marked as a duplicate of this bug. ***