mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-22 07:51:39 +08:00
Fix PR#30303 - no matching function for call to '__ptr_in_range'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@280779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -195,4 +195,13 @@ int main()
|
||||
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
|
||||
}
|
||||
|
||||
{ // test appending a different type
|
||||
typedef std::string S;
|
||||
const uint8_t p[] = "ABCD";
|
||||
|
||||
S s;
|
||||
s.append(p, p + 4);
|
||||
assert(s == "ABCD");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -196,4 +196,13 @@ int main()
|
||||
s_long.assign(s_long.begin() + 30, s_long.end());
|
||||
assert(s_long == "nsectetur/");
|
||||
}
|
||||
|
||||
{ // test assigning a different type
|
||||
typedef std::string S;
|
||||
const uint8_t p[] = "ABCD";
|
||||
|
||||
S s;
|
||||
s.assign(p, p + 4);
|
||||
assert(s == "ABCD");
|
||||
}
|
||||
}
|
||||
|
@@ -186,4 +186,12 @@ int main()
|
||||
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
|
||||
}
|
||||
|
||||
{ // test assigning a different type
|
||||
typedef std::string S;
|
||||
const uint8_t p[] = "ABCD";
|
||||
|
||||
S s;
|
||||
s.insert(s.begin(), p, p + 4);
|
||||
assert(s == "ABCD");
|
||||
}
|
||||
}
|
||||
|
@@ -1023,4 +1023,18 @@ int main()
|
||||
s_long.replace(s_long.begin(), s_long.begin(), s_long.begin(), s_long.end());
|
||||
assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/");
|
||||
}
|
||||
|
||||
{ // test assigning a different type
|
||||
typedef std::string S;
|
||||
const uint8_t pc[] = "ABCD";
|
||||
uint8_t p[] = "EFGH";
|
||||
|
||||
S s;
|
||||
s.replace(s.begin(), s.end(), pc, pc + 4);
|
||||
assert(s == "ABCD");
|
||||
|
||||
s.clear();
|
||||
s.replace(s.begin(), s.end(), p, p + 4);
|
||||
assert(s == "EFGH");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user