g++ crashed with casting
Bug #398175 reported by
Michael Tsang
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:/
$ 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:/
$
To post a comment you must log in.
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 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
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-
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 //usr/share/ doc/gcc- 4.3/README. Bugs> for instructions.
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:/