From 1b8322ecbf14c5939116e2de8ff7e8612ffca1c6 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Sat, 4 Jan 2014 22:03:10 -0600 Subject: [PATCH] fix trac 9544: gcc 4.9.0 -std=c++1y breakage This is GCC bug PR C++/59681 but the Boost fix is trivial and the GCC one is (probably) not. See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59681 --- include/boost/regex/v4/basic_regex_creator.hpp | 2 +- include/boost/regex/v4/basic_regex_parser.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index 1c2c5d90..821fb829 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -344,7 +344,7 @@ re_literal* basic_regex_creator::append_literal(charT c) m_last_state = result = static_cast(getaddress(off)); charT* characters = static_cast(static_cast(result+1)); characters[result->length] = m_traits.translate(c, m_icase); - ++(result->length); + result->length += 1; } return result; } diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 4b103f22..27578988 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -971,7 +971,7 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ // the last state was a literal with more than one character, split it in two: re_literal* lit = static_cast(this->m_last_state); charT c = (static_cast(static_cast(lit+1)))[lit->length - 1]; - --(lit->length); + lit->length -= 1; // now append new state: lit = static_cast(this->append_state(syntax_element_literal, sizeof(re_literal) + sizeof(charT))); lit->length = 1;