Open Baron-von-Riedesel opened 8 months ago
My knowledge for C++ is also limited. The OW C++ compiler is using very old C++ standard C++98 that some limitation can caused this message. I hope @pchapin will comment this issue.
I think it's a compiler bug. Template members are one of the most recent additions to the Open Watcom C++ compiler and have some other limitations. Also, the compiler does not allow one to explicitly specialize function templates (contrary to C++ 98). Frankly, I'm surprised the example works as well as it does! The compiler seems to understand that channel::BlockTemplate<sm3FM>
is an explicit specialization of a template member function. While that's legal C++, I wouldn't have expected Open Watcom to understand that.
So, yes, the compiler is confused... but not as confused as I would have thought!
I get this error when trying to compile DosBox's FM synthesizer with OW. I stripped down the code to a relatively simple test case:
Feeding OW's wcc386 with it emits:
Which is a bit strange since source and targer don't differ. I'm no C++ expert, but I ran this test case with gcc, OW, Borland C++ v5.5.1 and the MS VC++ Toolkit 2003 - and it's just OW that chokes.
Attached is the test case, with .BATs how I ran the various compilers
tmpl.zip