Skip to content

Commit 0d4eabd

Browse files
Update recordings for the new array comparison diagnostics. [GH #370]
1 parent d5a1e7d commit 0d4eabd

10 files changed

Lines changed: 126 additions & 2 deletions

File tree

‎tests/expectations/edg_x86_64/imported.log‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,6 @@ clang/cpp/SemaCXX/vtordisp-mode.sft.cpp:fp:-DTEST_NUMBER=3 --c++11 -DVTORDISP_MO
14431443
clang/cpp/SemaCXX/warn-array-comparion.sft.cpp:fn:-DTEST_NUMBER=1 --c++17:FAIL:
14441444
clang/cpp/SemaCXX/warn-array-comparion.sft.cpp:fn:-DTEST_NUMBER=2 --c++20:FAIL:
14451445
clang/cpp/SemaCXX/warn-array-comparion.sft.cpp:fn:-DTEST_NUMBER=3 --c++20:FAIL:
1446-
clang/cpp/SemaCXX/warn-array-comparion.sft.cpp:fn:-DTEST_NUMBER=4 --c++26:FAIL:
14471446
clang/cpp/SemaCXX/warn-bool-conversion.sft.cpp:fn:-DTEST_NUMBER=1 --c++03:FAIL:
14481447
clang/cpp/SemaCXX/warn-cast-function-type-strict.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:
14491448
clang/cpp/SemaCXX/warn-cast-function-type.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:
@@ -1455,7 +1454,6 @@ clang/cpp/SemaCXX/warn-memsize-comparison.sft.cpp:fn:-DTEST_NUMBER=1:FAIL:
14551454
clang/cpp/SemaCXX/warn-nrvo.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:
14561455
clang/cpp/SemaCXX/warn-self-comparisons.sft.cpp:fn:-DTEST_NUMBER=1 --c++17:FAIL:
14571456
clang/cpp/SemaCXX/warn-self-comparisons.sft.cpp:fn:-DTEST_NUMBER=2 --c++20:FAIL:
1458-
clang/cpp/SemaCXX/warn-self-comparisons.sft.cpp:fn:-DTEST_NUMBER=3 --c++26:FAIL:
14591457
clang/cpp/SemaCXX/warn-static-const-float.sft.cpp:fn:-DTEST_NUMBER=1 --c++03 -DEXT --c++03 -DNONE --c++03 -DNONE --c++03 -DNONE:FAIL:
14601458
clang/cpp/SemaCXX/warn-static-const-float.sft.cpp:fn:-DTEST_NUMBER=2 --c++11 -DERR:FAIL:
14611459
clang/cpp/SemaCXX/warn-static-const-float.sft.cpp:fn:-DTEST_NUMBER=3 --c++11 -DERR:FAIL:

‎tests/tests/imported/clang/cpp/SemaCXX/.deprecated.rto/default.8.1.txt‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,26 @@ fe_only -DTEST_NUMBER=8 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers
164164
void trex(volatile short left_arm, volatile struct amber right_arm);
165165
^
166166

167+
"SemaCXX/deprecated.cpp", line 256: warning: comparison between two arrays is deprecated
168+
bool b1 = arr1 == arr2;
169+
^
170+
171+
"SemaCXX/deprecated.cpp", line 258: warning: comparison between two arrays is deprecated
172+
bool b2 = arr1 < arr2;
173+
^
174+
175+
"SemaCXX/deprecated.cpp", line 261: warning: comparison between two arrays is deprecated
176+
bool b3 = arr1 == arr3;
177+
^
178+
179+
"SemaCXX/deprecated.cpp", line 262: warning: comparison between two arrays is deprecated
180+
bool b4 = arr1 < arr3;
181+
^
182+
183+
"SemaCXX/deprecated.cpp", line 268: warning: comparison between two arrays is deprecated
184+
bool b6 = arr1 == f();
185+
^
186+
167187
"SemaCXX/deprecated.cpp", line 280: warning: parameter "x" was set but never used
168188
[[deprecated]] void f2([[deprecated]] int x) {
169189
^

‎tests/tests/imported/clang/cpp/SemaCXX/.deprecated.rto/default.9.1.txt‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,26 @@ fe_only -DTEST_NUMBER=9 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers
152152
void trex(volatile short left_arm, volatile struct amber right_arm);
153153
^
154154

155+
"SemaCXX/deprecated.cpp", line 256: warning: comparison between two arrays is deprecated
156+
bool b1 = arr1 == arr2;
157+
^
158+
159+
"SemaCXX/deprecated.cpp", line 258: warning: comparison between two arrays is deprecated
160+
bool b2 = arr1 < arr2;
161+
^
162+
163+
"SemaCXX/deprecated.cpp", line 261: warning: comparison between two arrays is deprecated
164+
bool b3 = arr1 == arr3;
165+
^
166+
167+
"SemaCXX/deprecated.cpp", line 262: warning: comparison between two arrays is deprecated
168+
bool b4 = arr1 < arr3;
169+
^
170+
171+
"SemaCXX/deprecated.cpp", line 268: warning: comparison between two arrays is deprecated
172+
bool b6 = arr1 == f();
173+
^
174+
155175
"SemaCXX/deprecated.cpp", line 280: warning: parameter "x" was set but never used
156176
[[deprecated]] void f2([[deprecated]] int x) {
157177
^

‎tests/tests/imported/clang/cpp/SemaCXX/.self-comparison.rto/default.1.1.txt‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 --c++20 Test_name.c
2+
"Test_name.c", line 21: warning: comparison between two arrays is deprecated
3+
bool h() { return a == b; } // expected-warning {{array comparison always evaluates to false}} expected-warning {{deprecated}}
4+
^
5+
6+
"Test_name.c", line 24: warning: comparison between two arrays is deprecated
7+
return a == c; // expected-warning {{array comparison always evaluates to false}} expected-warning {{deprecated}}
8+
^
9+
10+
"Test_name.c", line 30: warning: comparison between two arrays is deprecated
11+
bool k = NA::x == NB::x; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
12+
^
13+
214
"Test_name.c", line 53: warning: statement is unreachable
315
return static_field == static_field; // expected-warning {{self-comparison always evaluates to true}}
416
^
@@ -39,6 +51,10 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers
3951
return s1.array == s1.array; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
4052
^
4153

54+
"Test_name.c", line 87: warning: comparison between two arrays is deprecated
55+
return s1.array == s1.array; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
56+
^
57+
4258
"Test_name.c", line 88: warning: statement is unreachable
4359
return t.s.static_field == S::static_field; // expected-warning {{self-comparison always evaluates to true}}
4460
^
@@ -103,6 +119,10 @@ fe_only -DTEST_NUMBER=1 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers
103119
return s2.array == s1.array; // FIXME: This always evaluates to false. expected-warning {{deprecated}}
104120
^
105121

122+
"Test_name.c", line 108: warning: comparison between two arrays is deprecated
123+
return s2.array == s1.array; // FIXME: This always evaluates to false. expected-warning {{deprecated}}
124+
^
125+
106126
"Test_name.c", line 109: warning: statement is unreachable
107127
return s2.array[0] == s1.array[0];
108128
^

‎tests/tests/imported/clang/cpp/SemaCXX/.self-comparison.rto/default.2.1.txt‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 --c++20 Test_name.c
2+
"Test_name.c", line 21: warning: comparison between two arrays is deprecated
3+
bool h() { return a == b; } // expected-warning {{array comparison always evaluates to false}} expected-warning {{deprecated}}
4+
^
5+
6+
"Test_name.c", line 24: warning: comparison between two arrays is deprecated
7+
return a == c; // expected-warning {{array comparison always evaluates to false}} expected-warning {{deprecated}}
8+
^
9+
10+
"Test_name.c", line 30: warning: comparison between two arrays is deprecated
11+
bool k = NA::x == NB::x; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
12+
^
13+
214
"Test_name.c", line 53: warning: statement is unreachable
315
return static_field == static_field; // expected-warning {{self-comparison always evaluates to true}}
416
^
@@ -39,6 +51,10 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers
3951
return s1.array == s1.array; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
4052
^
4153

54+
"Test_name.c", line 87: warning: comparison between two arrays is deprecated
55+
return s1.array == s1.array; // expected-warning {{self-comparison always evaluates to true}} expected-warning {{deprecated}}
56+
^
57+
4258
"Test_name.c", line 88: warning: statement is unreachable
4359
return t.s.static_field == S::static_field; // expected-warning {{self-comparison always evaluates to true}}
4460
^
@@ -103,6 +119,10 @@ fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_vers
103119
return s2.array == s1.array; // FIXME: This always evaluates to false. expected-warning {{deprecated}}
104120
^
105121

122+
"Test_name.c", line 108: warning: comparison between two arrays is deprecated
123+
return s2.array == s1.array; // FIXME: This always evaluates to false. expected-warning {{deprecated}}
124+
^
125+
106126
"Test_name.c", line 109: warning: statement is unreachable
107127
return s2.array[0] == s1.array[0];
108128
^
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 --c++20 Test_name.c
2+
"Test_name.c", line 14: warning: comparison between two arrays is deprecated
3+
if (obj1.str != obj2.str) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
4+
^
5+
6+
"Test_name.c", line 16: warning: comparison between two arrays is deprecated
7+
if (obj1.id != obj2.id) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
8+
^
9+
10+
"Test_name.c", line 23: warning: comparison between two arrays is deprecated
11+
if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
12+
^
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 --c++20 Test_name.c
2+
"Test_name.c", line 14: warning: comparison between two arrays is deprecated
3+
if (obj1.str != obj2.str) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
4+
^
5+
6+
"Test_name.c", line 16: warning: comparison between two arrays is deprecated
7+
if (obj1.id != obj2.id) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
8+
^
9+
10+
"Test_name.c", line 23: warning: comparison between two arrays is deprecated
11+
if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
12+
^
13+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
11
fe_only -DTEST_NUMBER=4 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 --c++26 Test_name.c
2+
"Test_name.c", line 14: error: comparison between two arrays is not allowed
3+
if (obj1.str != obj2.str) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
4+
^
5+
6+
"Test_name.c", line 16: error: comparison between two arrays is not allowed
7+
if (obj1.id != obj2.id) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
8+
^
9+
10+
"Test_name.c", line 23: error: comparison between two arrays is not allowed
11+
if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
12+
^
13+
14+
3 errors detected in the compilation of "Test_name.c".
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
fe_only -DTEST_NUMBER=2 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 --c++20 Test_name.c
2+
"Test_name.c", line 8: warning: comparison between two arrays is deprecated
3+
if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
4+
^
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
fe_only -DTEST_NUMBER=3 --clang -tused -e 200 --no_wrap_diagnostics --clang_version 999999 --c++26 Test_name.c
2+
"Test_name.c", line 8: error: comparison between two arrays is not allowed
3+
if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}}
4+
^
5+
6+
1 error detected in the compilation of "Test_name.c".

0 commit comments

Comments
 (0)