[Prev][Next][Index]

SgClassStmt::setSuperClass() bug




This bit of code in libSage++.C:

void SgClassStmt::setSuperClass(int i, SgSymbol &type_symb, int access)
{    
  PTR_LLND pt;

  if((access != BIT_PRIVATE) && (access != (BIT_PRIVATE | BIT_VIRTUAL)) &&
     (access != BIT_PROTECTED) && (access != (BIT_PROTECTED | BIT_VIRTUAL)) &&
     (access != BIT_PUBLIC) && (access != (BIT_PRIVATE | BIT_VIRTUAL))){


should be changed to look like this:

void SgClassStmt::setSuperClass(int i, SgSymbol &type_symb, int access)
{    
  PTR_LLND pt;

  if((access != BIT_PRIVATE) && (access != (BIT_PRIVATE | BIT_VIRTUAL)) &&
     (access != BIT_PROTECTED) && (access != (BIT_PROTECTED | BIT_VIRTUAL)) &&
     (access != BIT_PUBLIC) && (access != (BIT_PUBLIC | BIT_VIRTUAL))){


note the BIT_PRIVATE on the third line was changed to BIT_PUBLIC.  Otherwise
setSuperClass() doesn't allow "public virtual" inheritance.

-John