qualified type `C' does not match destructor name `~I'

Roberto Bagnara bagnara@di.unipi.it
Mon Apr 27 09:11:00 GMT 1998


/*
Reading 12.4 I understand that the fragment

  void foo(I* p)
  {
    p->I::~I();
  }

should be ok whatever type I is.
(Point 15 in 12.4 specifies that it works also for scalar types,
e.g., typedef int I.)

However, if I define

    typedef C I;

for C almost anything
(e.g.

   class C {
   public:
     int i;
   };

see below) both the egcs snapshots of 18 and 25 April give

/u/local/bin/g++ -c -Wall bugrep1.cc
bugrep1.cc: In function `void foo(class I *)':
bugrep1.cc:52: qualified type `C' does not match destructor name `~I'

Note that all the egcs releases do not have this problem.
Other info;

$ /u/local/bin/g++ -v
Reading specs from /u/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.25/specs
gcc version egcs-2.91.25 19980425 (gcc2 ss-980401 experimental)

$ uname -a
Linux kasper 2.0.32 #6 Sun Mar 22 22:05:21 CET 1998 i586 unknown

Hope this helps.

      Roberto

-- 
Roberto Bagnara
Department of Mathematics, University of Parma, Italy
http://www.di.unipi.it/~bagnara/bagnara.html
mailto:bagnara@di.unipi.it

*/

class C {
public:
  int i;
};

typedef C I;

void foo(I* p)
{
  p->I::~I();
}



More information about the Gcc-bugs mailing list