[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::c_plus_plus

Title:C++
Notice:Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS)
Moderator:DECCXX::AMARTIN
Created:Fri Nov 06 1987
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3604
Total number of notes:18242

3595.0. "problem with constructor of nested class" by FLYWAY::LORENCEZ () Mon Jun 02 1997 08:45

    /*
     Problem report: The following code cannot be compiled
    
     Compilation command:
    
     cxx -V -c -o A.o A.cxx
    cxx  (cxx)
    DEC C++ V5.5-004 on Digital UNIX (Alpha)
    Internal compiler error detected at line 7071 in file
    /usr/proj/decc2/v55_cxx/src/cxxfe/cxsymtab.c.
    cxx: Fatal: A memory access violation (bus error or segmentation fault)
    has occurred.  Please submit a problem report.
    
     Compiler:
     DEC C++ V5.5-004 on Digital UNIX (Alpha)
    
     OS:
     Digital UNIX V4.0A  (Rev. 464)
    
     HW:
     DEC 3000
    */
    
    class A
    {
      public:
        A() {}
    
        class B
        {
          public:
    #if 0
          B() {}
    #else
          B();
    #endif
        };
    };
    
    #if 1
    A::B() {}
    #endif
    
    
    // changing the 1st #if to #if 1 and the 2nd to #if 0 allows
    compilation
    
T.RTitleUserPersonal
Name
DateLines
3595.1compiler should not core dump, it should give a compilation errorDECC::J_WARDMon Jun 02 1997 10:5318

A::B() is incorrect as the declaration of the B constructor...

A::B::B() is correct.

The compiler should properly diagnose this (:

This is what our development 6.0 compiler says:

"t.cxx", line 19: error: expected an identifier
      A::B() {}
           ^

"t.cxx", line 19: error: expected a ";"
      A::B() {}
             ^