Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaType.cpp | ||
---|---|---|
2523 | It looks like clang and gcc treat this attribute on array types differently. Consider the non-dependent case: typedef int myvect[4] __attribute__((vector_size(16))); GCC treats this as an array of four 16 byte vectors. Clang tries to apply the attribute to the array type and rejects it here, rather than applying it to the inner type. I think the change is correct, but I'd suggest simplifying the condition: we can reject the vector_size attribute on all array types, whether they are dependent or not. You should be able to remove the CurType->isDependentType() && clause. Can you make sure we have a test for the non-dependent array type case? You can use the typedef I have above. |
It looks like clang and gcc treat this attribute on array types differently. Consider the non-dependent case:
https://gcc.godbolt.org/z/n6Prfd
GCC treats this as an array of four 16 byte vectors. Clang tries to apply the attribute to the array type and rejects it here, rather than applying it to the inner type.
I think the change is correct, but I'd suggest simplifying the condition: we can reject the vector_size attribute on all array types, whether they are dependent or not. You should be able to remove the CurType->isDependentType() && clause. Can you make sure we have a test for the non-dependent array type case? You can use the typedef I have above.