-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Fix for adding macro I #111872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc] Fix for adding macro I #111872
Conversation
@llvm/pr-subscribers-libc Author: Shourya Goel (Sh0g0-1758) ChangesWe have two files in which we are using Full diff: https://github.com/llvm/llvm-project/pull/111872.diff 2 Files Affected:
diff --git a/libc/src/__support/CPP/string_view.h b/libc/src/__support/CPP/string_view.h
index 88f5270c3170a3..745c62c35f0a0a 100644
--- a/libc/src/__support/CPP/string_view.h
+++ b/libc/src/__support/CPP/string_view.h
@@ -31,8 +31,8 @@ class string_view {
LIBC_INLINE static int compareMemory(const char *Lhs, const char *Rhs,
size_t Length) {
- for (size_t I = 0; I < Length; ++I)
- if (int Diff = (int)Lhs[I] - (int)Rhs[I])
+ for (size_t i = 0; i < Length; ++i)
+ if (int Diff = (int)Lhs[i] - (int)Rhs[i])
return Diff;
return 0;
}
diff --git a/libc/src/__support/CPP/utility/in_place.h b/libc/src/__support/CPP/utility/in_place.h
index b5411f247d5519..3967eb1c535e45 100644
--- a/libc/src/__support/CPP/utility/in_place.h
+++ b/libc/src/__support/CPP/utility/in_place.h
@@ -27,11 +27,11 @@ template <class T> struct in_place_type_t {
};
template <class T> LIBC_INLINE_VAR constexpr in_place_type_t<T> in_place_type{};
-template <size_t I> struct in_place_index_t {
+template <size_t IDX> struct in_place_index_t {
LIBC_INLINE explicit in_place_index_t() = default;
};
-template <size_t I>
-LIBC_INLINE_VAR constexpr in_place_index_t<I> in_place_index{};
+template <size_t IDX>
+LIBC_INLINE_VAR constexpr in_place_index_t<IDX> in_place_index{};
} // namespace cpp
} // namespace LIBC_NAMESPACE_DECL
|
can we merge this ? Would be required for #111659 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, do you need me to merge this for you?
✅ With the latest revision this PR passed the C/C++ code formatter. |
@michaelrj-google there were two more files for which I changed the type |
7e4d47c
to
1d2fe2f
Compare
We have two (EDIT: 4) files in which we are using `I`. This PR replaces them with alternatives like `i` and `IDX` etc.
We have two (EDIT: 4) files in which we are using
I
. This PR replaces them with alternatives likei
andIDX
etc.