================
@@ -20,7 +20,7 @@ struct __attribute__((internal_linkage)) S { // 
expected-warning{{'internal_link
 __attribute__((internal_linkage("foo"))) int g(void) {} // 
expected-error{{'internal_linkage' attribute takes no arguments}}
 
 int var6 [[clang::internal_linkage]];
-int var7 [[clang::internal_linkage]] __attribute__((common)); // 
expected-error{{'clang::internal_linkage' and 'common' attributes are not 
compatible}} \
+int var7 [[clang::internal_linkage]] __attribute__((common)); // 
expected-error{{'common' and 'clang::internal_linkage' attributes are not 
compatible}} \
----------------
hnrklssn wrote:

For context this is what the diagnostic looks like in the terminal:
```
internal_linkage.c:23:53: error: 'common' and 'clang::internal_linkage' 
attributes are not compatible
   23 | int var7 [[clang::internal_linkage]] __attribute__((common));
      |                                                     ^
internal_linkage.c:23:12: note: conflicting attribute is here
   23 | int var7 [[clang::internal_linkage]] __attribute__((common));
      |            ^
```

I think it makes sense to emit the error on the last occurring attribute, and I 
also think it makes sense to mention the erroring attribute first in the 
diagnostics message. This is also what this diagnostic _almost_ always did 
already.

Would you prefer that the diagnostic was rephrased? Maybe something like 
`attribute 'common' not compatible with attribute 'clang::internal_linkage'`?

https://github.com/llvm/llvm-project/pull/162714
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to