[Bug c++/12824] New: Parse error when casting to typedef'd type in nested constructor argument

tony dot berry at misys dot com gcc-bugzilla@gcc.gnu.org
Wed Oct 29 13:35:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12824

           Summary: Parse error when casting to typedef'd type  in nested
                    constructor argument
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tony dot berry at misys dot com
                CC: gcc-bugs at gcc dot gnu dot org

Output from terminal session on AIX 5.1, using GCC 3.3. Bug originally observed 
in GCC 3.2.x on Red Hat Linux 9. The simplest example I have of the problem 
requires a cast, to a type that has been defined with 'typedef', within two 
levels of class constructor call.

% cat bug.cxx
typedef int     integer;
class   Integer { public: Integer (integer) {} };
class   Number  { public: Number (const Integer&) {} };
static  void    Bug ()
{
        Number  x (Integer ((integer)0));
        /*
        Integer i ((integer)0); Number y (i);           // That's OK !
        Number  z (Integer ((int)0));                   // That's OK, too.
        */
}
% gcc -v
Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.3/specs
Configured with: ../gcc-3.3/configure 
Thread model: aix
gcc version 3.3
% g++ -c bug.cxx
bug.cxx: In function `void Bug()':
bug.cxx:6: error: parse error before numeric constant



More information about the Gcc-bugs mailing list