Skip to content

Commit e2de6a1

Browse files
committed
Small cleanup in tests
B -> A (why start naming at B?) a -> p (for pointer)
1 parent 21f1514 commit e2de6a1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,17 +3731,17 @@ TEST_P(UncheckedOptionalAccessTest, ConstPointerAccessor) {
37313731
ExpectDiagnosticsFor(R"cc(
37323732
#include "unchecked_optional_access_test.h"
37333733
3734-
struct B {
3734+
struct A {
37353735
$ns::$optional<int> x;
37363736
};
37373737
37383738
struct MyUniquePtr {
3739-
B* operator->() const;
3739+
A* operator->() const;
37403740
};
37413741
3742-
void target(MyUniquePtr a) {
3743-
if (a->x) {
3744-
*a->x;
3742+
void target(MyUniquePtr p) {
3743+
if (p->x) {
3744+
*p->x;
37453745
}
37463746
}
37473747
)cc",
@@ -3752,19 +3752,19 @@ TEST_P(UncheckedOptionalAccessTest, ConstPointerAccessorWithModInBetween) {
37523752
ExpectDiagnosticsFor(R"cc(
37533753
#include "unchecked_optional_access_test.h"
37543754
3755-
struct B {
3755+
struct A {
37563756
$ns::$optional<int> x;
37573757
};
37583758
37593759
struct MyUniquePtr {
3760-
B* operator->() const;
3761-
void reset(B*);
3760+
A* operator->() const;
3761+
void reset(A*);
37623762
};
37633763
3764-
void target(MyUniquePtr a) {
3765-
if (a->x) {
3766-
a.reset(nullptr);
3767-
*a->x; // [[unsafe]]
3764+
void target(MyUniquePtr p) {
3765+
if (p->x) {
3766+
p.reset(nullptr);
3767+
*p->x; // [[unsafe]]
37683768
}
37693769
}
37703770
)cc",

0 commit comments

Comments
 (0)