This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/43392] New: g++ 4.4.1 [C++0X]: segmentation fault with empty initializer list
- From: "jt at toerring dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Mar 2010 17:42:16 -0000
- Subject: [Bug c++/43392] New: g++ 4.4.1 [C++0X]: segmentation fault with empty initializer list
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When trying to compile this program
#include <vector>
class Baz {
private:
int foo, bar;
public:
Baz(int a = 0, int b = 0) : foo(a), bar(b) {}
};
int main()
{
std::vector<Baz> a = {{}, {1, 2}};
}
with
g++ -std=c++0x -W -Wall -o t t.cpp
the compiler crashes with the errror message
t.cpp: In function â??int main()â??:
t.cpp:12: internal compiler error: Segmentation fault
The critical point seems to be the empty initializer list in the first position
- if moved to a later position the program gets compiled without problems.
Using different flags does not seem to have eny effect.
Here's the complete output of 'gcc -v':
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.1-4ubuntu9'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror
--with-arch-32=i486 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)
Best Regards, Jens
PS: Sorry, I don't see how I could append the 't.ii' file created with the
'-save-temps' option, that seems to be a bit too long for putting it directly
into this form...
--
Summary: g++ 4.4.1 [C++0X]: segmentation fault with empty
initializer list
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jt at toerring dot de
GCC build triplet: 4.4.1
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43392