Bug report

Philippe Bouchard boucp00@DMI.USherb.CA
Thu Oct 28 10:15:00 GMT 1999


I'm not sure if it is a bug, but would be interesting to fix. Here is the
source:
#include <iostream.h>
template <class TYPE> class H {
   TYPE * p;
 
public:
   void operator = (void * o) {
      p = (TYPE *) o;
      }
 
   ~H() { if (p) delete p; }
 
   TYPE * operator -> () {
      return p;
      }
   };
signature S {
   void func();
   };
struct O {
   void func() { cout<<__PRETTY_FUNCTION__<<endl;
}
   };
void main() {
   // Works well (prints 'void O::func()'):
      {
      S * s;
      s = new O;
      s->func();
      }
 
   // Doesn't:
      {
      H<S> s;
      s = new O;
      s->func();
      }
   }
Doesn't compile & prints:
[...]$ g++ -fhandle-signatures signature1.cc
signature1.cc: In function `int main(...)':
signature1.cc:38: no matching function for call to `S::func ()'
signature1.cc:19: candidates are: S::func()
Current version:
[...]$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
 
PAB



More information about the Gcc-bugs mailing list