Commit dad61d03 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

src: Don't allow const char * in 2nd argument of strieq_l(S[N], T)

parent 1bbb241b
......@@ -296,14 +296,9 @@ bool strieq_l(const CharT(&a)[N], InputIt b, size_t blen) {
return strieq(a, a + (N - 1), b, b + blen);
}
template <typename CharT, size_t N>
bool strieq_l(const CharT(&a)[N], const std::string &b) {
return strieq(a, a + (N - 1), std::begin(b), std::end(b));
}
template <typename CharT, size_t N>
bool strieq_l(const CharT(&a)[N], const StringRef &b) {
return strieq(a, a + (N - 1), std::begin(b), std::end(b));
template <typename CharT, size_t N, typename T>
bool strieq_l(const CharT(&a)[N], const T &b) {
return strieq(a, a + (N - 1), b.begin(), b.end());
}
template <typename InputIt1, typename InputIt2>
......
......@@ -91,11 +91,11 @@ void test_util_strieq(void) {
CU_ASSERT(!util::strieq_l("alpha", "AlPhA ", 6));
CU_ASSERT(!util::strieq_l("", "AlPhA ", 6));
CU_ASSERT(util::strieq_l("alpha", "alpha"));
CU_ASSERT(util::strieq_l("alpha", "AlPhA"));
CU_ASSERT(util::strieq_l("", ""));
CU_ASSERT(!util::strieq_l("alpha", "AlPhA "));
CU_ASSERT(!util::strieq_l("", "AlPhA "));
CU_ASSERT(util::strieq_l("alpha", StringRef::from_lit("alpha")));
CU_ASSERT(util::strieq_l("alpha", StringRef::from_lit("AlPhA")));
CU_ASSERT(util::strieq_l("", StringRef{}));
CU_ASSERT(!util::strieq_l("alpha", StringRef::from_lit("AlPhA ")));
CU_ASSERT(!util::strieq_l("", StringRef::from_lit("AlPhA ")));
}
void test_util_inp_strlower(void) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment