g++ crashed with casting

Bug #398175 reported by Michael Tsang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-defaults (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

$ cat gcc_bug.cpp
int main(){
        typedef const int&&trrc;
        trrc(0);
}
$ g++ -std=c++0x gcc_bug.cpp -o gcc_bug
gcc_bug.cpp: In function ‘int main()’:
gcc_bug.cpp:3: internal compiler error: in cp_build_c_cast, at cp/typeck.c:5832
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
$ g++-4.3 -std=c++0x gcc_bug.cpp -o gcc_bug
gcc_bug.cpp: In function ‘int main()’:
gcc_bug.cpp:3: internal compiler error: in build_c_cast, at cp/typeck.c:5659
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.
$

Revision history for this message
Felix Crux (felixc) wrote :

I can confirm this on my version of GCC as well (though I can't claim to understand what the code is *supposed* to do. But clearly the way it fails is incorrect). All the info required for an upstream bug report is reproduced below. I could not find an upstream bug for this issue, so perhaps it should be passed on up to them? I did not do so myself because the bug reporting instructions don't seem too friendly to reports from distro-specific packages.

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)

$ cat test.cpp
int main(){
        typedef const int&&trrc;
        trrc(0);
}

$ cat test.ii
# 1 "test.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.cpp"
int main(){
        typedef const int&&trrc;
        trrc(0);
}

$ g++ -std=c++0x -save-temps test.cpp
test.cpp: In function ‘int main()’:
test.cpp:3: internal compiler error: in build_c_cast, at cp/typeck.c:5659
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.

Changed in gcc-defaults (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

fixed in both 4.3 and 4.4 in karmic

Changed in gcc-defaults (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.