This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[libstdc++/gcc-4.9] missing return statement in basic_regex::assign(basic_regex&&)
- From: PaweÅ Tomulik <ptomulik at meil dot pw dot edu dot pl>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 13 Feb 2015 14:46:27 +0100
- Subject: [libstdc++/gcc-4.9] missing return statement in basic_regex::assign(basic_regex&&)
- Authentication-results: sourceware.org; auth=none
Hi,
the header file <bits/regex.h> is missing return statement in the
implementation of basic_regex::assign(basic_regex&&). This is about line
619. The minimal example to reproduce this bug is the following:
#include <regex>
int main()
{
std::regex re;
re.assign(std::regex("blabla"));
return EXIT_SUCCESS;
}
When compiled with clang and run it produces SIGILL:
ptomulik@tea:$ clang++ -std=c++11 -g -O0 -o test test.cpp
ptomulik@tea:$ ./test
I attach patch created with git against the "gcc-4_9_2-release" tag.
Best regards.
--
PaweÅ Tomulik, tel. (22) 234 7925
Instytut Techniki Lotniczej i Mechaniki Stosowanej
Politechnika Warszawska
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index fe10ceb..af5a414 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -623,6 +623,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_original_str = std::move(__rhs._M_original_str);
__rhs._M_automaton.reset();
this->imbue(__rhs.getloc());
+ return *this;
}
/**