[clang] [analyzer] Update the undefined assignment checker diagnostics to not use the term 'garbage' (PR #126596)
David Tarditi via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 10 12:50:47 PST 2025
https://github.com/dtarditi created https://github.com/llvm/llvm-project/pull/126596
A clang user pointed out that messages for the static analyzer undefined assignment checker use the term 'garbage'. This is kind of snarky and also imprecise. This change replaces the term 'garbage' in those messages with 'not meaningful'. It moves the term 'undefined' to be first in the messages because of the possible ambiguous parsing of the term 'not
meaningful and undefined'. That could be parsed as '(not meaningful) and undefined' or 'not (meaningful and undefined').
The use of the term 'meaningless' was considered, but not chosen because it has two meanings in English. One meaning is 'without meaning'. The other meaning is 'having no point'. The 2nd meaning could be construed
as indicating the computation could be deleted.
rdar://133418644
>From 06eb6682196249f4cae9801963380d0881d27296 Mon Sep 17 00:00:00 2001
From: David Tarditi <d_tarditi at apple.com>
Date: Mon, 10 Feb 2025 11:35:45 -0800
Subject: [PATCH 1/2] [analyzer] Update undefined assignment diagnostics to not
use 'garbage'
A clang user pointed out that messages for the static analyzer undefined
assignment checker use the term 'garbage'. This is kind of snarky and
also imprecise. This change replaces the term 'garbage' in those messages
with 'not meaningful'. It moves the term 'undefined' to be first in the
messages because of the possible ambiguous parsing of the term 'not
meaningful and undefined'. That could be parsed as '(not meaningful)
and undefined' or 'not (meaningful and undefined').
The use of the term 'meaningless' was considered, but not chosen because
it has two meanings in English. One meaning is 'without meaning'. The
other meaning is 'having no point'. The 2nd meaning could be construed
as indicating the computation could be deleted.
rdar://133418644
---
.../Checkers/UndefinedAssignmentChecker.cpp | 13 ++++----
.../Inputs/expected-plists/edges-new.mm.plist | 10 +++----
.../expected-plists/plist-output.m.plist | 10 +++----
clang/test/Analysis/a_flaky_crash.cpp | 2 +-
.../analysis-after-multiple-dtors.cpp | 2 +-
clang/test/Analysis/array-init-loop.cpp | 6 ++--
clang/test/Analysis/array-punned-region.c | 2 +-
clang/test/Analysis/builtin_overflow_notes.c | 4 +--
clang/test/Analysis/call-invalidation.cpp | 4 +--
clang/test/Analysis/ctor-array.cpp | 22 +++++++-------
.../diagnostics/no-store-func-path-notes.m | 4 +--
clang/test/Analysis/fread.c | 20 ++++++-------
.../Analysis/implicit-ctor-undef-value.cpp | 12 ++++----
clang/test/Analysis/initialization.c | 16 +++++-----
clang/test/Analysis/initialization.cpp | 26 ++++++++--------
clang/test/Analysis/misc-ps.c | 4 +--
clang/test/Analysis/operator-calls.cpp | 8 ++---
clang/test/Analysis/stack-addr-ps.cpp | 2 +-
clang/test/Analysis/uninit-const.c | 20 ++++++-------
clang/test/Analysis/uninit-const.cpp | 4 +--
.../uninit-structured-binding-array.cpp | 30 +++++++++----------
.../uninit-structured-binding-struct.cpp | 12 ++++----
.../uninit-structured-binding-tuple.cpp | 4 +--
clang/test/Analysis/uninit-vals.m | 8 ++---
.../test/Analysis/zero-size-non-pod-array.cpp | 4 +--
25 files changed, 125 insertions(+), 124 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
index ddc6cc9e8202c7c..f13de315ed7b5e8 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
@@ -23,7 +23,7 @@ using namespace ento;
namespace {
class UndefinedAssignmentChecker
: public Checker<check::Bind> {
- const BugType BT{this, "Assigned value is garbage or undefined"};
+ const BugType BT{this, "Assigned value is undefined and not meaningful"};
public:
void checkBind(SVal location, SVal val, const Stmt *S,
@@ -57,8 +57,8 @@ void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
while (StoreE) {
if (const UnaryOperator *U = dyn_cast<UnaryOperator>(StoreE)) {
- OS << "The expression is an uninitialized value. "
- "The computed value will also be garbage";
+ OS << "The expression is an uninitialized value, so the computed value "
+ << "is not meaningful";
ex = U->getSubExpr();
break;
@@ -68,7 +68,7 @@ void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
if (B->isCompoundAssignmentOp()) {
if (C.getSVal(B->getLHS()).isUndef()) {
OS << "The left expression of the compound assignment is an "
- "uninitialized value. The computed value will also be garbage";
+ << "uninitialized value, so the computed value is not meaningful";
ex = B->getLHS();
break;
}
@@ -88,8 +88,9 @@ void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
if (CD->isImplicit()) {
for (auto *I : CD->inits()) {
if (I->getInit()->IgnoreImpCasts() == StoreE) {
- OS << "Value assigned to field '" << I->getMember()->getName()
- << "' in implicit constructor is garbage or undefined";
+ OS << "Value assigned to field '"
+ << I->getMember()->getName()
+ << "' in implicit constructor is undefined and not meaningful.";
break;
}
}
diff --git a/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist b/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
index 31b6286b4465e4d..dd731e705c9b0b2 100644
--- a/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
@@ -2578,17 +2578,17 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+ <string>The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful</string>
<key>message</key>
- <string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+ <string>The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful</string>
</dict>
</array>
- <key>description</key><string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+ <key>description</key><string>The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful</string>
<key>category</key><string>Logic error</string>
- <key>type</key><string>Assigned value is garbage or undefined</string>
+ <key>type</key><string>Assigned value is undefined and not meaningful</string>
<key>check_name</key><string>core.uninitialized.Assign</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>025372576cd3ba6716044f93a51c978c</string>
+ <key>issue_hash_content_of_line_in_context</key><string>936a5fabf36091d0c1e1e1553232d6f5</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>test_objc_fast_enumeration_2</string>
<key>issue_hash_function_offset</key><string>5</string>
diff --git a/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist b/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
index 8b8cc3239bd4bd8..392474d24487c6b 100644
--- a/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
@@ -5864,17 +5864,17 @@
</array>
<key>depth</key><integer>0</integer>
<key>extended_message</key>
- <string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+ <string>The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful</string>
<key>message</key>
- <string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+ <string>The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful</string>
</dict>
</array>
- <key>description</key><string>The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage</string>
+ <key>description</key><string>The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful</string>
<key>category</key><string>Logic error</string>
- <key>type</key><string>Assigned value is garbage or undefined</string>
+ <key>type</key><string>Assigned value is undefined and not meaningful</string>
<key>check_name</key><string>core.uninitialized.Assign</string>
<!-- This hash is experimental and going to change! -->
- <key>issue_hash_content_of_line_in_context</key><string>21c774309bdfd487c3d09a61a671bbcc</string>
+ <key>issue_hash_content_of_line_in_context</key><string>c1d7b1284317d7e45bda4bfa6b3a281e</string>
<key>issue_context_kind</key><string>function</string>
<key>issue_context</key><string>test_loop_fast_enumeration</string>
<key>issue_hash_function_offset</key><string>5</string>
diff --git a/clang/test/Analysis/a_flaky_crash.cpp b/clang/test/Analysis/a_flaky_crash.cpp
index f350c1e1280cf3e..5a3fa25f82baa4c 100644
--- a/clang/test/Analysis/a_flaky_crash.cpp
+++ b/clang/test/Analysis/a_flaky_crash.cpp
@@ -14,7 +14,7 @@ bool bar(S);
void foo() {
int x;
if (true && bar(S()))
- ++x; // expected-warning{{The expression is an uninitialized value. The computed value will also be garbage}}
+ ++x; // expected-warning{{The expression is an uninitialized value, so the computed value is not meaningful}}
}
// 256 copies of the same run-line to make it crash more often when it breaks.
diff --git a/clang/test/Analysis/analysis-after-multiple-dtors.cpp b/clang/test/Analysis/analysis-after-multiple-dtors.cpp
index a8f6d38fbd1bbfc..c202752ee1a56b9 100644
--- a/clang/test/Analysis/analysis-after-multiple-dtors.cpp
+++ b/clang/test/Analysis/analysis-after-multiple-dtors.cpp
@@ -23,6 +23,6 @@ int main() {
int x;
int y = x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
(void)y;
}
diff --git a/clang/test/Analysis/array-init-loop.cpp b/clang/test/Analysis/array-init-loop.cpp
index b28468b7f560b2c..cb26bda95abf881 100644
--- a/clang/test/Analysis/array-init-loop.cpp
+++ b/clang/test/Analysis/array-init-loop.cpp
@@ -19,7 +19,7 @@ void array_uninit() {
auto [a, b, c, d, e] = arr;
- int x = e; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = e; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void lambda_init() {
@@ -168,7 +168,7 @@ struct S3_duplicate {
void array_uninit_non_pod() {
S3 arr[1];
- auto [a] = arr; // expected-warning at 159{{ in implicit constructor is garbage or undefined }}
+ auto [a] = arr; // expected-warning at 159{{ in implicit constructor is undefined and not meaningful}}
}
void lambda_init_non_pod() {
@@ -191,7 +191,7 @@ void lambda_init_non_pod() {
void lambda_uninit_non_pod() {
S3_duplicate arr[4];
- int l = [arr] { return arr[3].i; }(); // expected-warning at 164{{ in implicit constructor is garbage or undefined }}
+ int l = [arr] { return arr[3].i; }(); // expected-warning at 164{{ in implicit constructor is undefined and not meaningful }}
}
// If this struct is being copy/move constructed by the implicit ctors, ArrayInitLoopExpr
diff --git a/clang/test/Analysis/array-punned-region.c b/clang/test/Analysis/array-punned-region.c
index d319fd7367ec5b0..c997611e2d3a75b 100644
--- a/clang/test/Analysis/array-punned-region.c
+++ b/clang/test/Analysis/array-punned-region.c
@@ -20,7 +20,7 @@ void array_struct_bitfield_1() {
int array_struct_bitfield_2() {
BITFIELD_CAST ff = {0};
BITFIELD_CAST *pff = &ff;
- int a = *((int *)pff + 2); // expected-warning{{Assigned value is garbage or undefined [core.uninitialized.Assign]}}
+ int a = *((int *)pff + 2); // expected-warning{{Assigned value is undefined and not meaningful [core.uninitialized.Assign]}}
return a;
}
diff --git a/clang/test/Analysis/builtin_overflow_notes.c b/clang/test/Analysis/builtin_overflow_notes.c
index 20f333a4a6cca56..e8d0e60ad80b046 100644
--- a/clang/test/Analysis/builtin_overflow_notes.c
+++ b/clang/test/Analysis/builtin_overflow_notes.c
@@ -23,8 +23,8 @@ void test_overflow_note(int a, int b)
if (__builtin_add_overflow(a, b, &res)) { // expected-note {{Assuming overflow}}
// expected-note at -1 {{Taking true branch}}
- int var = res; // expected-warning{{Assigned value is garbage or undefined}}
- // expected-note at -1 {{Assigned value is garbage or undefined}}
+ int var = res; // expected-warning{{Assigned value is undefined and not meaningful}}
+ // expected-note at -1 {{Assigned value is undefined and not meaningful}}
return;
}
}
diff --git a/clang/test/Analysis/call-invalidation.cpp b/clang/test/Analysis/call-invalidation.cpp
index fb2b892b31a1f73..96869c5abeabba8 100644
--- a/clang/test/Analysis/call-invalidation.cpp
+++ b/clang/test/Analysis/call-invalidation.cpp
@@ -197,7 +197,7 @@ int testStdCtorDoesNotInvalidateParentObject() {
int testStdCtorDoesNotInvalidateParentObjectSwapped() {
StdWrappingOpaqueSwapped obj;
int x = obj.o.nested_member; // no-garbage: std::Opaque::ctor might initialized this
- int y = obj.uninit; // expected-warning {{Assigned value is garbage or undefined}}
+ int y = obj.uninit; // expected-warning {{Assigned value is undefined and not meaningful}}
return x + y;
}
@@ -277,6 +277,6 @@ struct StdWrappingFancyOpaque {
int testNestedStdNamespacesAndRecords() {
StdWrappingFancyOpaque obj;
int x = obj.o.nested_member; // no-garbage: ctor
- int y = obj.uninit; // expected-warning {{Assigned value is garbage or undefined}}
+ int y = obj.uninit; // expected-warning {{Assigned value is undefined and not meaningful}}
return x + y;
}
diff --git a/clang/test/Analysis/ctor-array.cpp b/clang/test/Analysis/ctor-array.cpp
index 52600b314b010f3..4a35df7834d6abd 100644
--- a/clang/test/Analysis/ctor-array.cpp
+++ b/clang/test/Analysis/ctor-array.cpp
@@ -12,19 +12,19 @@ struct s {
void a1(void) {
s arr[3];
int x = arr[0].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
void a2(void) {
s arr[3];
int x = arr[1].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
void a3(void) {
s arr[3];
int x = arr[2].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
struct s2 {
@@ -37,7 +37,7 @@ void b1(void) {
clang_analyzer_eval(arr[0].y == 2); // expected-warning{{TRUE}}
int x = arr[0].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
void b2(void) {
@@ -45,7 +45,7 @@ void b2(void) {
clang_analyzer_eval(arr[1].y == 2); // expected-warning{{TRUE}}
int x = arr[1].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
void b3(void) {
@@ -53,7 +53,7 @@ void b3(void) {
clang_analyzer_eval(arr[2].y == 2); // expected-warning{{TRUE}}
int x = arr[2].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
void c1(void) {
@@ -70,7 +70,7 @@ void c1(void) {
clang_analyzer_eval(arr[1].y == 2); // expected-warning{{TRUE}}
int x = arr[1].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
}
@@ -100,7 +100,7 @@ void e1(void) {
clang_analyzer_eval(arr[1].arr[1].y == 2); // expected-warning{{TRUE}}
int x = arr[1].sarr[1].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
void f1(void) {
@@ -108,7 +108,7 @@ void f1(void) {
clang_analyzer_eval(arr[1][1].y == 2); // expected-warning{{TRUE}}
int x = arr[1][1].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
struct s5 {
@@ -168,14 +168,14 @@ void h2(void) {
s a[2][2], b[2][2];
int x = a[1][1].x;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
void h3(void) {
s a[2][2], b[2][2];
int x = b[1][1].y;
- // expected-warning at -1{{Assigned value is garbage or undefined}}
+ // expected-warning at -1{{Assigned value is undefined and not meaningful}}
}
struct Base {
diff --git a/clang/test/Analysis/diagnostics/no-store-func-path-notes.m b/clang/test/Analysis/diagnostics/no-store-func-path-notes.m
index 4826b38b98a56b3..c972b85771e5357 100644
--- a/clang/test/Analysis/diagnostics/no-store-func-path-notes.m
+++ b/clang/test/Analysis/diagnostics/no-store-func-path-notes.m
@@ -47,8 +47,8 @@ int initFromBlock(void) {
int p; // expected-note{{'p' declared without an initial value}}
initializer1(&p, 0); // expected-note{{Calling 'initializer1'}}
// expected-note at -1{{Returning from 'initializer1'}}
- z = p; // expected-warning{{Assigned value is garbage or undefined}}
- // expected-note at -1{{Assigned value is garbage or undefined}}
+ z = p; // expected-warning{{Assigned value is undefined and not meaningful}}
+ // expected-note at -1{{Assigned value is undefined and not meaningful}}
}();
return z;
}
diff --git a/clang/test/Analysis/fread.c b/clang/test/Analysis/fread.c
index 8dc998ea1e899d0..61b72122d328e17 100644
--- a/clang/test/Analysis/fread.c
+++ b/clang/test/Analysis/fread.c
@@ -113,9 +113,9 @@ void random_access_read1(int index) {
case 0:
// c[0] is not mutated by fread.
if (success) {
- char p = c[0]; // expected-warning {{Assigned value is garbage or undefined}} We kept the first byte intact.
+ char p = c[0]; // expected-warning {{Assigned value is undefined and not meaningful}} We kept the first byte intact.
} else {
- char p = c[0]; // expected-warning {{Assigned value is garbage or undefined}} We kept the first byte intact.
+ char p = c[0]; // expected-warning {{Assigned value is undefined and not meaningful}} We kept the first byte intact.
}
break;
@@ -147,9 +147,9 @@ void random_access_read1(int index) {
case 3:
// c[3] is not mutated by fread.
if (success) {
- long p = c[3]; // expected-warning {{Assigned value is garbage or undefined}}
+ long p = c[3]; // expected-warning {{Assigned value is undefined and not meaningful}}
} else {
- long p = c[3]; // expected-warning {{Assigned value is garbage or undefined}}
+ long p = c[3]; // expected-warning {{Assigned value is undefined and not meaningful}}
}
break;
}
@@ -169,10 +169,10 @@ void random_access_read2(int b) {
clang_analyzer_isTainted(p); // expected-warning {{YES}}
clang_analyzer_dump(p); // expected-warning {{conj_}}
} else {
- int p = buffer[0]; // expected-warning {{Assigned value is garbage or undefined}}
+ int p = buffer[0]; // expected-warning {{Assigned value is undefined and not meaningful}}
}
} else {
- int p = buffer[0]; // expected-warning {{Assigned value is garbage or undefined}}
+ int p = buffer[0]; // expected-warning {{Assigned value is undefined and not meaningful}}
}
fclose(fp);
}
@@ -283,9 +283,9 @@ void compound_read2(void) {
if (fp) {
struct S s; // s.a is not touched by fread.
if (1 == fread(&s.b, sizeof(s.b), 1, fp)) {
- long p = s.a; // expected-warning {{Assigned value is garbage or undefined}}
+ long p = s.a; // expected-warning {{Assigned value is undefined and not meaningful}}
} else {
- long p = s.a; // expected-warning {{Assigned value is garbage or undefined}}
+ long p = s.a; // expected-warning {{Assigned value is undefined and not meaningful}}
}
fclose(fp);
}
@@ -296,9 +296,9 @@ void var_read(void) {
if (fp) {
int a, b; // 'a' is not touched by fread.
if (1 == fread(&b, sizeof(b), 1, fp)) {
- long p = a; // expected-warning{{Assigned value is garbage or undefined}}
+ long p = a; // expected-warning{{Assigned value is undefined and not meaningful}}
} else {
- long p = a; // expected-warning{{Assigned value is garbage or undefined}}
+ long p = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
fclose(fp);
}
diff --git a/clang/test/Analysis/implicit-ctor-undef-value.cpp b/clang/test/Analysis/implicit-ctor-undef-value.cpp
index 87824c0533a0a36..f5d805609e5cce6 100644
--- a/clang/test/Analysis/implicit-ctor-undef-value.cpp
+++ b/clang/test/Analysis/implicit-ctor-undef-value.cpp
@@ -9,8 +9,8 @@ struct S {
// Warning is in a weird position because the body of the constructor is
// missing. Specify which field is being assigned.
-class C { // expected-warning{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
- // expected-note at -1{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
+class C { // expected-warning{{Value assigned to field 'y' in implicit constructor is undefined and not meaningful}}
+ // expected-note at -1{{Value assigned to field 'y' in implicit constructor is undefined and not meaningful}}
int x, y;
S s;
@@ -34,8 +34,8 @@ class C {
// It is not necessary to specify which field is being assigned to.
C(const C &c):
x(c.x),
- y(c.y) // expected-warning{{Assigned value is garbage or undefined}}
- // expected-note at -1{{Assigned value is garbage or undefined}}
+ y(c.y) // expected-warning{{Assigned value is undefined and not meaningful}}
+ // expected-note at -1{{Assigned value is undefined and not meaningful}}
{}
};
@@ -53,8 +53,8 @@ struct S {
S(const S &) {}
};
-class C { // expected-warning{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
- // expected-note at -1{{Value assigned to field 'y' in implicit constructor is garbage or undefined}}
+class C { // expected-warning{{Value assigned to field 'y' in implicit constructor is undefined and not meaningful}}
+ // expected-note at -1{{Value assigned to field 'y' in implicit constructor is undefined and not meaningful}}
int x, y;
S s;
diff --git a/clang/test/Analysis/initialization.c b/clang/test/Analysis/initialization.c
index d394a902ffeb78c..daa40662477d93c 100644
--- a/clang/test/Analysis/initialization.c
+++ b/clang/test/Analysis/initialization.c
@@ -49,13 +49,13 @@ void glob_array_index2(void) {
void glob_invalid_index1(void) {
int x = -42;
- int res = glob_arr1[x]; // expected-warning{{garbage or undefined}}
+ int res = glob_arr1[x]; // expected-warning{{undefined and not meaningful}}
}
void glob_invalid_index2(void) {
const int *ptr = glob_arr1;
int x = 42;
- int res = ptr[x]; // expected-warning{{garbage or undefined}}
+ int res = ptr[x]; // expected-warning{{undefined and not meaningful}}
}
const int glob_arr2[3][3] = {[0][0] = 1, [1][1] = 5, [2][0] = 7};
@@ -81,12 +81,12 @@ void negative_index(void) {
void glob_invalid_index3(void) {
int x = -1, y = -1;
- int res = glob_arr2[x][y]; // expected-warning{{garbage or undefined}}
+ int res = glob_arr2[x][y]; // expected-warning{{undefined and not meaningful}}
}
void glob_invalid_index4(void) {
int x = 3, y = 2;
- int res = glob_arr2[x][y]; // expected-warning{{garbage or undefined}}
+ int res = glob_arr2[x][y]; // expected-warning{{undefined and not meaningful}}
}
const int glob_arr_no_init[10];
@@ -106,12 +106,12 @@ void glob_arr_index5(void) {
void glob_invalid_index5(void) {
int x = 42;
- int res = glob_arr3[x]; // expected-warning{{garbage or undefined}}
+ int res = glob_arr3[x]; // expected-warning{{undefined and not meaningful}}
}
void glob_invalid_index6(void) {
int x = -42;
- int res = glob_arr3[x]; // expected-warning{{garbage or undefined}}
+ int res = glob_arr3[x]; // expected-warning{{undefined and not meaningful}}
}
const int glob_arr4[]; // IncompleteArrayType
@@ -126,10 +126,10 @@ void glob_arr_index6(void) {
void glob_invalid_index7(void) {
int x = 42;
- int res = glob_arr4[x]; // expected-warning{{garbage or undefined}}
+ int res = glob_arr4[x]; // expected-warning{{undefined and not meaningful}}
}
void glob_invalid_index8(void) {
int x = -42;
- int res = glob_arr4[x]; // expected-warning{{garbage or undefined}}
+ int res = glob_arr4[x]; // expected-warning{{undefined and not meaningful}}
}
diff --git a/clang/test/Analysis/initialization.cpp b/clang/test/Analysis/initialization.cpp
index e624ef5bae9e96e..4de98b7a189f72e 100644
--- a/clang/test/Analysis/initialization.cpp
+++ b/clang/test/Analysis/initialization.cpp
@@ -24,7 +24,7 @@ void glob_array_index1() {
void glob_invalid_index1() {
const int *ptr = glob_arr1;
int idx = -42;
- auto x = ptr[idx]; // expected-warning{{garbage or undefined}}
+ auto x = ptr[idx]; // expected-warning{{not meaningful}}
}
void glob_symbolic_index1(int idx) {
@@ -44,13 +44,13 @@ void glob_ptr_index1() {
void glob_invalid_index2() {
const int *ptr = glob_arr2;
int idx = 42;
- auto x = ptr[idx]; // expected-warning{{garbage or undefined}}
+ auto x = ptr[idx]; // expected-warning{{not meaningful}}
}
const float glob_arr3[] = {
0.0000, 0.0235, 0.0470, 0.0706, 0.0941, 0.1176};
float no_warn_garbage_value() {
- return glob_arr3[0]; // no-warning (garbage or undefined)
+ return glob_arr3[0]; // no-warning (not meaningful)
}
int const glob_arr4[4][2] = {};
@@ -62,13 +62,13 @@ void glob_array_index2() {
void glob_invalid_index3() {
int idx = -42;
- auto x = glob_arr4[1][idx]; // expected-warning{{garbage or undefined}}
+ auto x = glob_arr4[1][idx]; // expected-warning{{not meaningful}}
}
void glob_invalid_index4() {
const int *ptr = glob_arr4[1];
int idx = -42;
- auto x = ptr[idx]; // expected-warning{{garbage or undefined}}
+ auto x = ptr[idx]; // expected-warning{{not meaningful}}
}
int const glob_arr5[4][2] = {{1}, 3, 4, 5};
@@ -94,13 +94,13 @@ void glob_ptr_index2() {
void glob_invalid_index5() {
int idx = -42;
- auto x = glob_arr5[1][idx]; // expected-warning{{garbage or undefined}}
+ auto x = glob_arr5[1][idx]; // expected-warning{{not meaningful}}
}
void glob_invalid_index6() {
int const *ptr = &glob_arr5[1][0];
int idx = 42;
- auto x = ptr[idx]; // expected-warning{{garbage or undefined}}
+ auto x = ptr[idx]; // expected-warning{{not meaningful}}
}
extern const int glob_arr_no_init[10];
@@ -138,13 +138,13 @@ void glob_ptr_index3() {
void glob_invalid_index7() {
int idx = -42;
- auto x = glob_arr6[idx]; // expected-warning{{garbage or undefined}}
+ auto x = glob_arr6[idx]; // expected-warning{{not meaningful}}
}
void glob_invalid_index8() {
const char *ptr = glob_arr6;
int idx = 42;
- auto x = ptr[idx]; // expected-warning{{garbage or undefined}}
+ auto x = ptr[idx]; // expected-warning{{not meaningful}}
}
char const glob_arr7[5] = {"123"};
@@ -158,13 +158,13 @@ void glob_array_index6() {
void glob_invalid_index9() {
int idx = -42;
- auto x = glob_arr7[idx]; // expected-warning{{garbage or undefined}}
+ auto x = glob_arr7[idx]; // expected-warning{{not meaningful}}
}
void glob_invalid_index10() {
const char *ptr = glob_arr7;
int idx = 42;
- auto x = ptr[idx]; // expected-warning{{garbage or undefined}}
+ auto x = ptr[idx]; // expected-warning{{not meaningful}}
}
char const *const glob_ptr8 = "123";
@@ -180,12 +180,12 @@ void glob_ptr_index4() {
void glob_invalid_index11() {
int idx = -42;
- auto x = glob_ptr8[idx]; // expected-warning{{garbage or undefined}}
+ auto x = glob_ptr8[idx]; // expected-warning{{not meaningful}}
}
void glob_invalid_index12() {
int idx = 42;
- // FIXME: Should warn {{garbage or undefined}}
+ // FIXME: Should warn {{not meaningful}}
// We should take into account a declaration in which the literal is used.
auto x = glob_ptr8[idx]; // no-warning
}
diff --git a/clang/test/Analysis/misc-ps.c b/clang/test/Analysis/misc-ps.c
index d2f73ecb23082b0..7521c077a8517db 100644
--- a/clang/test/Analysis/misc-ps.c
+++ b/clang/test/Analysis/misc-ps.c
@@ -15,7 +15,7 @@ int rdar93730392(void) {
int extra = (2 + foo_rdar9373039 ("Clang") + ((4 - ((unsigned int) (2 + foo_rdar9373039 ("Clang")) % 4)) % 4)) + (2 + foo_rdar9373039 ("1.0") + ((4 - ((unsigned int) (2 + foo_rdar9373039 ("1.0")) % 4)) % 4)); // expected-warning {{never read}}
for (int i = 0 ; i < size_rdar9373039 ; ++i)
- j += x; // expected-warning {{garbage}}
+ j += x; // expected-warning {{undefined and not meaningful}}
return j;
}
@@ -156,7 +156,7 @@ int rdar_12075238_(unsigned long count) {
// Test that we handle an uninitialized value within a logical expression.
void PR14635(int *p) {
int a = 0, b;
- *p = a || b; // expected-warning {{Assigned value is garbage or undefined}}
+ *p = a || b; // expected-warning {{Assigned value is undefined and not meaningful}}
}
// Test handling floating point values with unary '!'.
diff --git a/clang/test/Analysis/operator-calls.cpp b/clang/test/Analysis/operator-calls.cpp
index 64abda150c5a144..b8d50974026d6d0 100644
--- a/clang/test/Analysis/operator-calls.cpp
+++ b/clang/test/Analysis/operator-calls.cpp
@@ -121,16 +121,16 @@ namespace SynthesizedAssignment {
void testNoWarning() {
B v, u;
- u = v; // expected-warning at 110{{Assigned value is garbage or undefined}}
+ u = v; // expected-warning at 110{{Assigned value is undefined and not meaningful}}
// expected-note at -1{{Calling defaulted copy assignment operator for 'B'}}
- // expected-note at 110{{Assigned value is garbage or undefined}}
+ // expected-note at 110{{Assigned value is undefined and not meaningful}}
}
void testNoWarningMove() {
B v, u;
- u = static_cast<B &&>(v); // expected-warning at 111{{Assigned value is garbage or undefined}}
+ u = static_cast<B &&>(v); // expected-warning at 111{{Assigned value is undefined and not meaningful}}
// expected-note at -1{{Calling defaulted move assignment operator for 'B'}}
- // expected-note at 111{{Assigned value is garbage or undefined}}
+ // expected-note at 111{{Assigned value is undefined and not meaningful}}
}
void testConsistency() {
diff --git a/clang/test/Analysis/stack-addr-ps.cpp b/clang/test/Analysis/stack-addr-ps.cpp
index 73e9dbeca460f60..6a325450dd2e821 100644
--- a/clang/test/Analysis/stack-addr-ps.cpp
+++ b/clang/test/Analysis/stack-addr-ps.cpp
@@ -106,7 +106,7 @@ struct TS {
};
int* f5() {
- int& i = i; // expected-warning {{Assigned value is garbage or undefined}} expected-warning{{reference 'i' is not yet bound to a value when used within its own initialization}}
+ int& i = i; // expected-warning {{Assigned value is undefined and not meaningful}} expected-warning{{reference 'i' is not yet bound to a value when used within its own initialization}}
return &i;
}
diff --git a/clang/test/Analysis/uninit-const.c b/clang/test/Analysis/uninit-const.c
index 06fca22c83c6d33..381e78f94eff091 100644
--- a/clang/test/Analysis/uninit-const.c
+++ b/clang/test/Analysis/uninit-const.c
@@ -94,8 +94,8 @@ void f_6_1(void) {
void f_7(void) {
int z; // expected-note {{'z' declared without an initial value}}
- int y=z; // expected-warning {{Assigned value is garbage or undefined}}
- // expected-note at -1 {{Assigned value is garbage or undefined}}
+ int y=z; // expected-warning {{Assigned value is undefined and not meaningful}}
+ // expected-note at -1 {{Assigned value is undefined and not meaningful}}
doStuff3(y);
}
@@ -133,26 +133,26 @@ void f_12(void) {
// https://bugs.llvm.org/show_bug.cgi?id=35419
void f11_0(void) {
int x; // expected-note {{'x' declared without an initial value}}
- x++; // expected-warning {{The expression is an uninitialized value. The computed value will also be garbage}}
- // expected-note at -1 {{The expression is an uninitialized value. The computed value will also be garbage}}
+ x++; // expected-warning {{The expression is an uninitialized value, so the computed value is not meaningful}}
+ // expected-note at -1 {{The expression is an uninitialized value, so the computed value is not meaningful}}
clang_analyzer_warnIfReached(); // no-warning
}
void f11_1(void) {
int x; // expected-note {{'x' declared without an initial value}}
- ++x; // expected-warning {{The expression is an uninitialized value. The computed value will also be garbage}}
- // expected-note at -1 {{The expression is an uninitialized value. The computed value will also be garbage}}
+ ++x; // expected-warning {{The expression is an uninitialized value, so the computed value is not meaningful}}
+ // expected-note at -1 {{The expression is an uninitialized value, so the computed value is not meaningful}}
clang_analyzer_warnIfReached(); // no-warning
}
void f11_2(void) {
int x; // expected-note {{'x' declared without an initial value}}
- x--; // expected-warning {{The expression is an uninitialized value. The computed value will also be garbage}}
- // expected-note at -1 {{The expression is an uninitialized value. The computed value will also be garbage}}
+ x--; // expected-warning {{The expression is an uninitialized value, so the computed value is not meaningful}}
+ // expected-note at -1 {{The expression is an uninitialized value, so the computed value is not meaningful}}
clang_analyzer_warnIfReached(); // no-warning
}
void f11_3(void) {
int x; // expected-note {{'x' declared without an initial value}}
- --x; // expected-warning {{The expression is an uninitialized value. The computed value will also be garbage}}
- // expected-note at -1 {{The expression is an uninitialized value. The computed value will also be garbage}}
+ --x; // expected-warning {{The expression is an uninitialized value, so the computed value is not meaningful}}
+ // expected-note at -1 {{The expression is an uninitialized value, so the computed value is not meaningful}}
clang_analyzer_warnIfReached(); // no-warning
}
diff --git a/clang/test/Analysis/uninit-const.cpp b/clang/test/Analysis/uninit-const.cpp
index 3ffcda1294abb76..b57ce0c1f90afa3 100644
--- a/clang/test/Analysis/uninit-const.cpp
+++ b/clang/test/Analysis/uninit-const.cpp
@@ -68,11 +68,11 @@ int& f6_1_sub(int &p) {
void f6_1(void) {
int t; // expected-note{{'t' declared without an initial value}}
- int p = f6_1_sub(t); //expected-warning {{Assigned value is garbage or undefined}}
+ int p = f6_1_sub(t); //expected-warning {{Assigned value is undefined and not meaningful}}
//expected-note at -1 {{Passing value via 1st parameter 'p'}}
//expected-note at -2 {{Calling 'f6_1_sub'}}
//expected-note at -3 {{Returning from 'f6_1_sub'}}
- //expected-note at -4 {{Assigned value is garbage or undefined}}
+ //expected-note at -4 {{Assigned value is undefined and not meaningful}}
int q = p;
doStuff6(q);
}
diff --git a/clang/test/Analysis/uninit-structured-binding-array.cpp b/clang/test/Analysis/uninit-structured-binding-array.cpp
index ed5439492818b47..ca8d9206c0f041c 100644
--- a/clang/test/Analysis/uninit-structured-binding-array.cpp
+++ b/clang/test/Analysis/uninit-structured-binding-array.cpp
@@ -7,7 +7,7 @@ void array_value_a(void) {
auto [a, b] = arr;
arr[0] = 0;
- int x = a; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_value_b(void) {
@@ -30,7 +30,7 @@ void array_value_c(void) {
clang_analyzer_eval(b == arr[1]); // expected-warning{{TRUE}}
int y = b; // no-warning
- int x = a; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_value_d(void) {
@@ -43,7 +43,7 @@ void array_value_d(void) {
clang_analyzer_eval(b == arr[1]); // expected-warning{{TRUE}}
int y = b; // no-warning
- int x = c; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = c; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_value_e(void) {
@@ -72,13 +72,13 @@ void array_value_f(void) {
clang_analyzer_eval(i == 0); // expected-warning{{TRUE}}
int a = i; // no-warning
- int b = j; // expected-warning{{Assigned value is garbage or undefined}}
+ int b = j; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_lref_a(void) {
int arr[2];
auto &[a, b] = arr;
- int x = a; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_lref_b(void) {
@@ -100,7 +100,7 @@ void array_lref_c(void) {
clang_analyzer_eval(a == 1); // expected-warning{{TRUE}}
int x = a; // no-warning
- int y = b; // expected-warning{{Assigned value is garbage or undefined}}
+ int y = b; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_lref_d(void) {
@@ -113,7 +113,7 @@ void array_lref_d(void) {
clang_analyzer_eval(b == 1); // expected-warning{{TRUE}}
int y = b; // no-warning
- int x = a; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_lref_e(void) {
@@ -126,7 +126,7 @@ void array_lref_e(void) {
clang_analyzer_eval(b == 1); // expected-warning{{TRUE}}
int y = b; // no-warning
- int x = c; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = c; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_lref_f(void) {
@@ -155,13 +155,13 @@ void array_lref_g(void) {
clang_analyzer_eval(i == 0); // expected-warning{{TRUE}}
int a = i; // no-warning
- int b = j; // expected-warning{{Assigned value is garbage or undefined}}
+ int b = j; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_rref_a(void) {
int arr[2];
auto &&[a, b] = arr;
- int x = a; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_rref_b(void) {
@@ -183,7 +183,7 @@ void array_rref_c(void) {
clang_analyzer_eval(a == 1); // expected-warning{{TRUE}}
int x = a; // no-warning
- int y = b; // expected-warning{{Assigned value is garbage or undefined}}
+ int y = b; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_rref_d(void) {
@@ -196,7 +196,7 @@ void array_rref_d(void) {
clang_analyzer_eval(b == 1); // expected-warning{{TRUE}}
int y = b; // no-warning
- int x = a; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_rref_e(void) {
@@ -209,7 +209,7 @@ void array_rref_e(void) {
clang_analyzer_eval(b == 1); // expected-warning{{TRUE}}
int y = b; // no-warning
- int x = c; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = c; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_rref_f(void) {
@@ -238,7 +238,7 @@ void array_rref_g(void) {
clang_analyzer_eval(i == 0); // expected-warning{{TRUE}}
int a = i; // no-warning
- int b = j; // expected-warning{{Assigned value is garbage or undefined}}
+ int b = j; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_change_a(void) {
@@ -276,7 +276,7 @@ void array_small_a(void) {
auto [a, b, c, d, e] = arr;
- int x = e; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = e; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void array_big_a(void) {
diff --git a/clang/test/Analysis/uninit-structured-binding-struct.cpp b/clang/test/Analysis/uninit-structured-binding-struct.cpp
index fec82c0d8589d6a..e2e601f9a16e716 100644
--- a/clang/test/Analysis/uninit-structured-binding-struct.cpp
+++ b/clang/test/Analysis/uninit-structured-binding-struct.cpp
@@ -12,7 +12,7 @@ void a(void) {
auto [i, j] = tst;
- int x = i; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = i; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void b(void) {
@@ -22,7 +22,7 @@ void b(void) {
auto [i, j] = tst;
clang_analyzer_eval(i == 1); // expected-warning{{TRUE}}
- int y = j; // expected-warning{{Assigned value is garbage or undefined}}
+ int y = j; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void c(void) {
@@ -30,7 +30,7 @@ void c(void) {
auto &[i, j] = tst;
- int x = i; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = i; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void d(void) {
@@ -43,7 +43,7 @@ void d(void) {
i = 2;
clang_analyzer_eval(tst.a == 2); // expected-warning{{TRUE}}
- int y = j; // expected-warning{{Assigned value is garbage or undefined}}
+ int y = j; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void e(void) {
@@ -63,7 +63,7 @@ void f(void) {
auto &&[i, j] = tst;
- int x = i; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = i; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void g(void) {
@@ -73,7 +73,7 @@ void g(void) {
auto &&[i, j] = tst;
clang_analyzer_eval(i == 1); // expected-warning{{TRUE}}
- int y = j; // expected-warning{{Assigned value is garbage or undefined}}
+ int y = j; // expected-warning{{Assigned value is undefined and not meaningful}}
}
struct s2 {
diff --git a/clang/test/Analysis/uninit-structured-binding-tuple.cpp b/clang/test/Analysis/uninit-structured-binding-tuple.cpp
index bc5644474fc9814..e7edf78b010116c 100644
--- a/clang/test/Analysis/uninit-structured-binding-tuple.cpp
+++ b/clang/test/Analysis/uninit-structured-binding-tuple.cpp
@@ -525,7 +525,7 @@ void uninit_a(void) {
auto [a, b] = u;
- int x = a; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = a; // expected-warning{{Assigned value is undefined and not meaningful}}
}
void uninit_b(void) {
@@ -533,7 +533,7 @@ void uninit_b(void) {
auto [a, b] = u;
- int x = b; // expected-warning{{Assigned value is garbage or undefined}}
+ int x = b; // expected-warning{{Assigned value is undefined and not meaningful}}
}
GENERATE_TUPLE_LIKE_STRUCT(UninitCall, int);
diff --git a/clang/test/Analysis/uninit-vals.m b/clang/test/Analysis/uninit-vals.m
index a6ec4fb74e128f8..af1638245863f74 100644
--- a/clang/test/Analysis/uninit-vals.m
+++ b/clang/test/Analysis/uninit-vals.m
@@ -34,8 +34,8 @@ void test_uninit_pos(void) {
struct TestUninit v1 = { 0, 0 };
struct TestUninit v2 = test_uninit_aux();
int z; // expected-note{{'z' declared without an initial value}}
- v1.y = z; // expected-warning{{Assigned value is garbage or undefined}}
- // expected-note at -1{{Assigned value is garbage or undefined}}
+ v1.y = z; // expected-warning{{Assigned value is undefined and not meaningful}}
+ // expected-note at -1{{Assigned value is undefined and not meaningful}}
test_unit_aux2(v2.x + v1.y);
}
void test_uninit_pos_2(void) {
@@ -78,8 +78,8 @@ void testFoo(Foo *o) {
void rdar_7780304(void) {
typedef struct s_r7780304 { int x; } s_r7780304;
s_r7780304 b;
- b.x |= 1; // expected-warning{{The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage}}
- // expected-note at -1{{The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage}}
+ b.x |= 1; // expected-warning{{The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful}}
+ // expected-note at -1{{The left expression of the compound assignment is an uninitialized value, so the computed value is not meaningful}}
}
diff --git a/clang/test/Analysis/zero-size-non-pod-array.cpp b/clang/test/Analysis/zero-size-non-pod-array.cpp
index a2117bc80eac89c..f897264e08f8e1f 100644
--- a/clang/test/Analysis/zero-size-non-pod-array.cpp
+++ b/clang/test/Analysis/zero-size-non-pod-array.cpp
@@ -124,7 +124,7 @@ void zeroSizeArrayLambdaCaptureUndefined1() {
int n;
auto l = [arr, n]{
- int x = n; //expected-warning{{Assigned value is garbage or undefined}}
+ int x = n; //expected-warning{{Assigned value is undefined and not meaningful}}
(void) x;
};
@@ -137,7 +137,7 @@ void zeroSizeArrayLambdaCaptureUndefined2() {
int n;
[arr, n]{
- int x = n; //expected-warning{{Assigned value is garbage or undefined}}
+ int x = n; //expected-warning{{Assigned value is undefined and not meaningful}}
(void) x;
}();
}
>From ec0b49ad499493f65f6496088efb09ea5831b54f Mon Sep 17 00:00:00 2001
From: David Tarditi <d_tarditi at apple.com>
Date: Mon, 10 Feb 2025 12:04:11 -0800
Subject: [PATCH 2/2] Fix clang format issue.
---
.../lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
index f13de315ed7b5e8..bdf705279351496 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp
@@ -88,8 +88,7 @@ void UndefinedAssignmentChecker::checkBind(SVal location, SVal val,
if (CD->isImplicit()) {
for (auto *I : CD->inits()) {
if (I->getInit()->IgnoreImpCasts() == StoreE) {
- OS << "Value assigned to field '"
- << I->getMember()->getName()
+ OS << "Value assigned to field '" << I->getMember()->getName()
<< "' in implicit constructor is undefined and not meaningful.";
break;
}
More information about the cfe-commits
mailing list