Skip to content

Commit cd2f65b

Browse files
committed
Correct some confused diagnostic terminology
Attributes accept arguments, not parameters, so we should report that the duplicate attribute arguments don't match.
1 parent ae7e842 commit cd2f65b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -9621,7 +9621,7 @@ def warn_duplicate_attribute_exact : Warning<
96219621
"attribute %0 is already applied">, InGroup<IgnoredAttributes>;
96229622

96239623
def warn_duplicate_attribute : Warning<
9624-
"attribute %0 is already applied with different parameters">,
9624+
"attribute %0 is already applied with different arguments">,
96259625
InGroup<IgnoredAttributes>;
96269626

96279627
def warn_sync_fetch_and_nand_semantics_change : Warning<

clang/test/Sema/attr-min-vector-width.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ void f(void) __attribute__((__min_vector_width__(i))); /* expected-error {{'__mi
55

66
void f2(void) __attribute__((__min_vector_width__(128)));
77

8-
void f3(void) __attribute__((__min_vector_width__(128), __min_vector_width__(256))); /* expected-warning {{attribute '__min_vector_width__' is already applied with different parameters}} */
8+
void f3(void) __attribute__((__min_vector_width__(128), __min_vector_width__(256))); /* expected-warning {{attribute '__min_vector_width__' is already applied with different arguments}} */
99

1010
void f4(void) __attribute__((__min_vector_width__())); /* expected-error {{'__min_vector_width__' attribute takes one argument}} */
1111

clang/test/SemaOpenCL/invalid-kernel-attrs.cl

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ kernel __attribute__((vec_type_hint(void))) void kernel3() {} //expected-error{{
88

99
kernel __attribute__((vec_type_hint(bool))) void kernel4() {} //expected-error{{a non-vector or non-vectorizable scalar type is an invalid argument to attribute 'vec_type_hint'}}
1010

11-
kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with different parameters}}
11+
kernel __attribute__((vec_type_hint(int))) __attribute__((vec_type_hint(float))) void kernel5() {} //expected-warning{{attribute 'vec_type_hint' is already applied with different arguments}}
1212

1313
kernel __attribute__((work_group_size_hint(8,16,32,4))) void kernel6() {} //expected-error{{'work_group_size_hint' attribute requires exactly 3 arguments}}
1414

15-
kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different parameters}}
15+
kernel __attribute__((work_group_size_hint(1,2,3))) __attribute__((work_group_size_hint(3,2,1))) void kernel7() {} //expected-warning{{attribute 'work_group_size_hint' is already applied with different arguments}}
1616

1717
__attribute__((reqd_work_group_size(8,16,32))) void kernel8(){} // expected-error {{attribute 'reqd_work_group_size' can only be applied to an OpenCL kernel}}
1818

@@ -36,7 +36,7 @@ kernel __attribute__((reqd_work_group_size(0,1,2))) void kernel13(){} // expecte
3636

3737
__attribute__((intel_reqd_sub_group_size(8))) void kernel14(){} // expected-error {{attribute 'intel_reqd_sub_group_size' can only be applied to an OpenCL kernel}}
3838
kernel __attribute__((intel_reqd_sub_group_size(0))) void kernel15(){} // expected-error {{'intel_reqd_sub_group_size' attribute must be greater than 0}}
39-
kernel __attribute__((intel_reqd_sub_group_size(8))) __attribute__((intel_reqd_sub_group_size(16))) void kernel16() {} //expected-warning{{attribute 'intel_reqd_sub_group_size' is already applied with different parameters}}
39+
kernel __attribute__((intel_reqd_sub_group_size(8))) __attribute__((intel_reqd_sub_group_size(16))) void kernel16() {} //expected-warning{{attribute 'intel_reqd_sub_group_size' is already applied with different arguments}}
4040

4141
__kernel __attribute__((work_group_size_hint(8,-16,32))) void neg1() {} //expected-error{{'work_group_size_hint' attribute requires a non-negative integral compile time constant expression}}
4242
__kernel __attribute__((reqd_work_group_size(8,16,-32))) void neg2(){} // expected-error{{'reqd_work_group_size' attribute requires a non-negative integral compile time constant expression}}

0 commit comments

Comments
 (0)