summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/regex.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/bits/regex.h')
-rw-r--r--libstdc++-v3/include/bits/regex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index 0d97d535e2a..d85be41f830 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -1749,7 +1749,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
*/
const_iterator
end() const
- { return _Base_type::end() - 3; }
+ { return _Base_type::end() - (empty() ? 0 : 3); }
/**
* @brief Gets an iterator to one-past-the-end of the collection.