This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52031] New: G++ crashes when std::size_t is initalized with a float inside a template
- From: "joseph.h.garvin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Jan 2012 23:07:16 +0000
- Subject: [Bug c++/52031] New: G++ crashes when std::size_t is initalized with a float inside a template
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52031
Bug #: 52031
Summary: G++ crashes when std::size_t is initalized with a
float inside a template
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: joseph.h.garvin@gmail.com
The following code snippet will crash G++ 4.6.1
#include <cstddef>
template<class T>
class B
{
static const std::size_t A = 1.5;
};
Output:
../crash.H:6:34: internal compiler error: in fold_convert_const_int_from_real,
at fold-const.c:1562
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccdymJZR.out file, please attach this to
your bugreport.
The mentioned file is attached. Note that it must be a templated class for the
crash to occur.