From: Michael J. Spencer Date: Wed, 20 Oct 2010 16:00:45 +0000 (+0000) Subject: Use C++03... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9f608b191956a761f5cbe2b3f0056206d04bd5b2;p=oota-llvm.git Use C++03... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116927 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc index 2dbf13e8ccb..7e2275105a3 100644 --- a/lib/System/Win32/Path.inc +++ b/lib/System/Win32/Path.inc @@ -68,7 +68,12 @@ Path::operator=(StringRef that) { struct ScopedNullTerminator { std::string &str; ScopedNullTerminator(std::string &s) : str(s) { str.push_back(0); } - ~ScopedNullTerminator() { str.pop_back(); } + ~ScopedNullTerminator() { + // str.pop_back(); But wait, C++03 doesn't have this... + assert(!str.empty() && str[str.size() - 1] == 0 + && "Null char not present!"); + str.resize(str.size() - 1); + } }; bool