http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53302
Bug #: 53302
Summary: a combination of union, perfect forwarding and
template parameter pack causes a seg-fault in program
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
My c++11 program compiles but causes a segmentation fault when run.
My GCC version is:
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
The command I compile with is:
g++ main.cpp -o test -std=c++0x
The contents of my program:
#include <utility>
#include <string>
union Union
{
bool dummy_;
std::string value_;
template <class... Args>
Union( Args&&... args ) : value_(std::forward<Args>(args)...) {}
~Union() { value_.std::string::~string(); }
};
struct Wrapper
{
bool b_;
Union u_;
Wrapper() : u_() {}
};
int main() {
Wrapper oi;
}