home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18860 < prev    next >
Encoding:
Text File  |  1993-01-08  |  764 b   |  32 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!ut-emx!tivoli!foraker!taylor
  2. From: taylor@foraker.tivoli.com (Eric Taylor)
  3. Newsgroups: comp.lang.c++
  4. Subject: typedefs in template class definitions
  5. Message-ID: <7648@tivoli.UUCP>
  6. Date: 8 Jan 93 22:22:15 GMT
  7. Sender: news@tivoli.UUCP
  8. Lines: 22
  9.  
  10. I am using GNU C++ ver. 2.3.3
  11.  
  12. I am having problems with the following type of declaration:
  13.  
  14. template <class T>
  15. class foo {
  16.     typedef int bar ;
  17.     void gag(bar x) ;
  18. } ;
  19.  
  20. template <class T>
  21. void foo<T>::gag(bar x)
  22. {
  23. }
  24.  
  25. It is as if bar was not entered into the symbol table as a typedef
  26. when parsing gag.
  27.  
  28. It does not matter if I change bar to foo<T>::bar or foo::bar
  29. (actually, I get different messages).
  30.  
  31. Am I doing something wrong, or is this a compiler bug?
  32.