This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53302] New: a combination of union, perfect forwarding and template parameter pack causes a seg-fault in program
- From: "akrzemi1 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 09 May 2012 22:17:42 +0000
- Subject: [Bug c++/53302] New: a combination of union, perfect forwarding and template parameter pack causes a seg-fault in program
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: akrzemi1@gmail.com
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;
}