This revision was automatically updated to reflect the committed changes.
Closed by commit rL285697: Protect exceptional paths under libcpp-no-exceptions
(authored by rogfer01).
Changed prior to commit:
https://reviews.llvm.org/D26136?vs=76566&id=76567#toc
Repository:
rL LLVM
https://review
rogfer01 updated this revision to Diff 76566.
rogfer01 added a comment.
Const-ify variables.
https://reviews.llvm.org/D26136
Files:
test/std/strings/basic.string/string.access/at.pass.cpp
test/std/strings/basic.string/string.capacity/reserve.pass.cpp
test/std/strings/basic.string/string.c
mclow.lists accepted this revision.
mclow.lists added a comment.
This revision is now accepted and ready to land.
Thanks for making these changes; I think this looks much better than before.
Feature creep: A bunch of the local variables can be marked as `const`.
Comment at:
te
rogfer01 updated the summary for this revision.
rogfer01 updated this revision to Diff 76532.
rogfer01 added a comment.
Update tests following Marshall's suggestion to avoid too much code
duplication. Also add assert(false) after the throwing action to ensure that
the expected exception is actua
mclow.lists added a comment.
This all looks ok to me - all mechanical changes.
I wonder if there's a better way to refactor these - there's all that
duplicated code.
Does this look any better to you?
Replace:
try
{
s.replace(pos1, n1, str, pos2);
LIBCPP_ASSERT(s.__invariants());
rmaprath added inline comments.
Comment at: test/std/strings/basic.string/string.access/at.pass.cpp:41
+const S& cs = s;
+if (pos < cs.size())
+{
rogfer01 wrote:
> rmaprath wrote:
> > For the cases where an exception //should've been// thrown, are we
rogfer01 added inline comments.
Comment at: test/std/strings/basic.string/string.access/at.pass.cpp:41
+const S& cs = s;
+if (pos < cs.size())
+{
rmaprath wrote:
> For the cases where an exception //should've been// thrown, are we not
> entering the
rmaprath added inline comments.
Comment at: test/std/strings/basic.string/string.access/at.pass.cpp:41
+const S& cs = s;
+if (pos < cs.size())
+{
For the cases where an exception //should've been// thrown, are we not entering
the **undefined** domain
rogfer01 created this revision.
rogfer01 added reviewers: EricWF, mclow.lists, rmaprath.
rogfer01 added a subscriber: cfe-commits.
This is another followup of https://reviews.llvm.org/D24562
These tests are of the form
try {
action-that-may-throw
assert(!exceptional-condition)
a