This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++ test
- To: gcc-bugs at gcc dot gnu dot org
- Subject: c++ test
- From: Eric Christopher <echristo at cygnus dot com>
- Date: Thu, 09 Nov 2000 16:10:07 -0800
This looks like valid code that's broken a couple of different ways
recently in the compiler. I don't have a fix for the most current way
(I do against the gcc that shipped in RH 7 (2), but that's of little use
right now).
Here are the two ways that this has failed:
1)
test.cc:17: invalid use of type decl `struct DATA' as expression
test.cc:17: parse error before ':' token
2)
test.cc: In function `int main ()':
test.cc:17: passing `const DATA' as `this' argument of `DATA::~DATA ()'
discards qualifiers
I believe the code is correct - though I'd love to hear if it isn't.
Should I add this as a testcase? If so, where?
-eric
#include <cstdio>
struct DATA {
DATA( void )
{
//-- Empty --
} ;
~DATA( void )
{
printf( "%-12s %04d:OK\n", __FILE__, __LINE__ ) ;
} ;
} ;
const DATA d ;
int main( void )
{
d.DATA::~DATA() ;
return( 0 ) ;
}