Bugzilla – Bug 447
[llvmg++] Crash compiling friend with default argument
Last modified: 2004-11-27 19:24:31
You need to log in before you can comment on or make changes to this bug.
I tested two example designs in SystemC version 2.0.1, and the same failure occurs. I think it occurs during the headfile preprocessing. The message is as following: .... /v/userc/fanyp/projects/SystemC/systemc- 2.0.1/include/systemc/datatypes/int/sc_unsigned.h:1939: internal compiler error: Segmentation fault .... You can download the SystemC library (intrinsic C++) from: http://www.systemc.org/projects/systemc
Can you please include a small preprocessed testcase that illustrates this bug? Thanks, -Chris
Created an attachment (id=176) [details] The preproccessed cpp file (gzipped)
Thanks for the testcase. I'm looking into it, but note that it breaks after emitting an error message. Try fixing the error, and the segfault might go away. I'll try to get a more satisfactory answer for you though :) -Chris
Here is a reduced testcase: namespace nm { struct str { friend int foo(int arg = 0); }; }
Okay, this is sick. After tracking down the bug, it turns out the GCC people found the exact same problem, and reduced it down to exactly the same testcase: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13166 I will merge their patches into our C++ parser to fix the problem. -Chris
Fixed. Testcase here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041122/021389.html Patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041122/021390.html -Chris