Skip to content

Commit 4001b82

Browse files
committed
[libc++][NFC] Rename member variables to avoid shadowing conflict in future patch
1 parent 69b3303 commit 4001b82

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

libcxx/test/support/check_assertion.h

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ struct DebugInfoMatcher {
4242
static constexpr const char* any_file = "*";
4343
static constexpr const char* any_msg = "*";
4444

45-
constexpr DebugInfoMatcher() : is_empty(true), msg(any_msg, __builtin_strlen(any_msg)), file(any_file, __builtin_strlen(any_file)), line(any_line) { }
46-
constexpr DebugInfoMatcher(const char* msg_, const char* file_ = any_file, int line_ = any_line)
47-
: is_empty(false), msg(msg_, __builtin_strlen(msg_)), file(file_, __builtin_strlen(file_)), line(line_) {}
45+
constexpr DebugInfoMatcher() : is_empty_(true), msg_(any_msg, __builtin_strlen(any_msg)), file_(any_file, __builtin_strlen(any_file)), line_(any_line) { }
46+
constexpr DebugInfoMatcher(const char* msg, const char* file = any_file, int line = any_line)
47+
: is_empty_(false), msg_(msg, __builtin_strlen(msg)), file_(file, __builtin_strlen(file)), line_(line) {}
4848

4949
bool Matches(std::__libcpp_debug_info const& got) const {
5050
assert(!empty() && "empty matcher");
@@ -59,25 +59,25 @@ struct DebugInfoMatcher {
5959
}
6060

6161
std::string ToString() const {
62-
std::string result = "msg = \""; result += msg; result += "\"\n";
63-
result += "line = " + (line == any_line ? "'*'" : std::to_string(line)) + "\n";
64-
result += "file = " + (file == any_file ? "'*'" : std::string(any_file));
62+
std::string result = "msg = \""; result += msg_; result += "\"\n";
63+
result += "line = " + (line_ == any_line ? "'*'" : std::to_string(line_)) + "\n";
64+
result += "file = " + (file_ == any_file ? "'*'" : std::string(file_));
6565
return result;
6666
}
6767

68-
bool empty() const { return is_empty; }
68+
bool empty() const { return is_empty_; }
6969
private:
7070
bool CheckLineMatches(int got_line) const {
71-
if (line == any_line)
71+
if (line_ == any_line)
7272
return true;
73-
return got_line == line;
73+
return got_line == line_;
7474
}
7575

7676
bool CheckFileMatches(std::string_view got_file) const {
7777
assert(!empty() && "empty matcher");
78-
if (file == any_file)
78+
if (file_ == any_file)
7979
return true;
80-
std::size_t found_at = got_file.find(file);
80+
std::size_t found_at = got_file.find(file_);
8181
if (found_at == std::string_view::npos)
8282
return false;
8383
// require the match start at the beginning of the file or immediately after
@@ -88,24 +88,24 @@ struct DebugInfoMatcher {
8888
return false;
8989
}
9090
// require the match goes until the end of the string.
91-
return got_file.substr(found_at) == file;
91+
return got_file.substr(found_at) == file_;
9292
}
9393

9494
bool CheckMessageMatches(std::string_view got_msg) const {
9595
assert(!empty() && "empty matcher");
96-
if (msg == any_msg)
96+
if (msg_ == any_msg)
9797
return true;
98-
std::size_t found_at = got_msg.find(msg);
98+
std::size_t found_at = got_msg.find(msg_);
9999
if (found_at == std::string_view::npos)
100100
return false;
101101
// Allow any match
102102
return true;
103103
}
104104
private:
105-
bool is_empty;
106-
std::string_view msg;
107-
std::string_view file;
108-
int line;
105+
bool is_empty_;
106+
std::string_view msg_;
107+
std::string_view file_;
108+
int line_;
109109
};
110110

111111
static constexpr DebugInfoMatcher AnyMatcher(DebugInfoMatcher::any_msg);
@@ -144,7 +144,6 @@ struct DeathTest {
144144
std::exit(RK_MatchFailure);
145145
}
146146

147-
148147
DeathTest(DebugInfoMatcher const& Matcher) : matcher_(Matcher) {}
149148

150149
template <class Func>

0 commit comments

Comments
 (0)