home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!uwm.edu!ogicse!news.u.washington.edu!uw-beaver!cornell!moudgill
- From: moudgill@cs.cornell.edu ( Mayan Moudgill)
- Newsgroups: comp.lang.c++
- Subject: Help!!! need a work-around for a bug in cfront 3.0.1
- Keywords: cfront 3.0.1, bug, example, workaround, help
- Message-ID: <1992Dec27.113136.3320@cs.cornell.edu>
- Date: 27 Dec 92 11:31:36 GMT
- Article-I.D.: cs.1992Dec27.113136.3320
- Organization: Cornell Univ. CS Dept, Ithaca NY 14853
- Lines: 58
-
- I found a bug in cfront 3.0.1. The included program exhibits this
- bug. Static functions A<T>::foo() and A<T>::bar() both
- call static function B<sizeof(T)>::gah(). gah() prints
- out the value of sz i.e. sizeof(T). They turn out to be
- different.
-
- Has anybody encountered this bug before? Could anybody suggest
- a workaround?
-
- please,
- Please,
- PLEASE,
- _PLEASE_,
- *PLEASE*
-
- :(
- Mayan
- (moudgill@cs.cornell.edu)
-
- ------------------------- CUT HERE ----------------------------
- #include <iostream.h>
-
- template<class T>
- class A {
- public:
- static int foo();
- static int bar();
- };
-
- template<unsigned sz>
- class B {
- public:
- static
- int gah()
- {
- cerr << sz << endl;
- return 0;
- }
- };
-
-
- template<class T>
- int A<T>::foo()
- {
- return B<sizeof(T)>::gah();
- }
-
- template<class T>
- int A<T>::bar()
- {
- return B<sizeof(T)>::gah();
- }
-
- main()
- {
- A<double>::foo();
- A<double>::bar();
- }
-