4 Replies Latest reply: Jul 29, 2014 12:24 PM by Steve.Clamage-Oracle RSS

    Assertion:   (../lnk/classutils.cc, line 299) - CC: Sun C++ 5.13 Beta2 2014/06/17

    2653080

      The test code is

       

      class X
      {
        int z : 3;

       

        X() : z(-1) {}
      };

       

      The result is:

       

      vkni@solaris:~/c++$ CC -c main.cpp
      >> Assertion:   (../lnk/classutils.cc, line 299)
          while processing main.cpp at line 0.

       

      If I rewrite the constructor like

        X()  { z =-1; }

       

      it compiles without any problem.

       

      P.S.

      The bug is probably in the parser code, because if I forget the last ";" the first variant will fail with assertion, while the second will tell me about missing ";" like

       

      "main.cpp", line 7: Error: Use ";" to terminate declarations.