Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* CXX compiler problem
@ 2001-11-01 10:20 Tobias Ernst
  2001-11-01 13:47 ` Andreas Unterkircher
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Ernst @ 2001-11-01 10:20 UTC (permalink / raw)


Hallo All!

I have a problem with the template instantiation code in CXX on this 
platform:

tobi@caracal(524):~/appt/pore> uname -a; cxx -V; cc -V
OSF1 caracal.ica1.uni-stuttgart.de V5.0 910 alpha
Compaq C++ V6.3-014 for Digital UNIX V5.0 (Rev. 910)
Compiler Driver V6.3-014 (cxx) cxx Driver
Compaq C V6.4-214 (dtk) on Digital UNIX V5.0 (Rev. 910)
Compiler Driver V6.4-014 (dtk) cc Driver

The error I get when linking my application is this:

Unresolved:
GrayHist<PTC_ParaIArray<3, signed char>, 3>::porosity(void)
GrayHist<PTC_ParaIArray<3, signed char>, 3>::alt_specsurf(void)

Now the problem is that the class PTC_ParaIArray is defined as

template <class T, int NDIM>
class PTC_ParaIArray:public PTC_ParaIArray_Base<T,NDIM>
{...};

So you see that the type parameter T must be first and the integer 
parameter NDIM must be last. The file that provides alt_specsurf and 
porosity contains the correct symbols (verified with nm):

GrayHist<PTC_ParaIArray<signed char, 3>, 3>::alt_specsurf(void) 
GrayHist<PTC_ParaIArray<signed char, 3>, 3>::porosity(void)

However, for some mysterious reason, the object file where I call these 
functions mysteriously contains requests for 

GrayHist<PTC_ParaIArray<3, signed char>, 3>::alt_specsurf(void)
GrayHist<PTC_ParaIArray<3, signed char>, 3>::porosity(void)

i.E. the integer parameter 3 before the type parameter signed char.

The cxx files that produce those two object files include the SAME .h 
file with the definitions of PTC_ParaIArray. So why on earth does cxx 
resort the template parameters in the one object file, but not in the 
other !?

The code compiles flawlessly with gcc 2.95.2 and with KAI KCC. The code 
does not work with Compaq CXX 6.3-014 and CXX 6.3-012.

If anybody is interested, I can compile a more formal testcase.

Viele Gr��e,
Tobias



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-11-02 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-01 10:20 CXX compiler problem Tobias Ernst
2001-11-01 13:47 ` Andreas Unterkircher
2001-11-02 13:45   ` Kenneth Block

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox