[Bug c++/86135] At run time, when the constructor tries to construct an objects element with a initializer-list (using c++11 style) is giving segmentation fault. The old style of initialize with parenthesis is working properly.
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 13 14:58:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86135
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Based on the names I'm assuming your code is the same as a case I analysed
recently, which reduces to:
#include <vector>
#include <memory>
struct object_t {
template <class T>
object_t(T object)
: obj{std::make_shared<model_t<T>>(std::move(object))}
{ }
struct concept_t {
virtual ~concept_t() = default;
};
template <class T>
struct model_t : concept_t {
model_t(T value) : _data{std::move(value)} {}
T _data;
};
std::shared_ptr<const concept_t> obj;
};
int main() {
std::vector<object_t> d;
std::vector<object_t> d2;
d.push_back(d2);
}
This crashes with a stack overflow, due to Core DR 2137. GCC appears to be
implementing the standard correctly.
More information about the Gcc-bugs
mailing list