This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/21903] Default argument of template function causes a compile-time error


------- Additional Comments From SSacek at appsecinc dot com  2005-06-04 18:28 -------

I would like to thank you folks at gcc.gnu.org for taking a serious look at 
this issue.

I wanted to write here a little bit about what I do and how this matter came 
to light. It is my occupation to write cross-platform applications that run on 
Linux, Solaris, and Windows operating systems. When I was developing my code, 
I started coding and compiling it on the Microsoft compiler first. I did not 
get any compiler errors from my code and was happy that it was correct. Then 
when I tried compiling it using GCC, I started getting the compile-time 
errors. My first instinct was to go back to my code and fix it. I usually do 
that because the Microsoft compiler isn?t as strict about the C++ language as 
GCC is. But I stared at the code for about an hour and couldn?t figure out 
what I was doing wrong.

Based on the error message that GCC gave me, "the default argument for 
parameter 1 has not yet been parsed", I concluded that this might be a rare 
case in which the GCC compiler got it wrong. I base that conclusion on the 
fact that the error message from GCC implies a sense of incompleteness in the 
class definition, and hence cannot generate object code. But the fact that the 
Microsoft compiler can begin generating code indicates that there is enough 
information there to begin instantiating the objects. I figured GCC should 
also be able to do the same with what was given.

Here at AppSecInc, where I work, we also tried the same tests with the ICC 
compiler and got the same results that Andrew Pinski mentioned. That actually 
surprised me at first, but then I couldn?t help but draw some conclusions 
about it. Intel is a hardware manufacturer, and not a compiler developer. I 
can?t help but believe that Intel didn?t want to re-invent the whole wheel, 
and therefore borrowed the open-source parser that the folks at GCC created.

These opinions are solely my own.

Thank you,
-Sid Sacek



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21903


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]