Boost logo

Boost :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2004-05-25 11:06:53


John Maddock ha escrito:

> > Warning: this diff has not actually been checked with ICC 8.0, but
> > I'm confident it'll work as the problem looks exactly the same as with
> > ICC 7.0:
>
> >I've just tested with ICC 8.0 and this patch surely works.
>
> Well it solves the problem, but the EDG based compilers are amongst the most
> conforming compilers we have access to, are we sure that this is a compiler
> bug, rather than a code bug? If yes, do you have a test case: as I can pass
> it on to Intel.
>

Hi John, I think I have reduced the problem to an actual bug in
EDG:

class A
{
protected:
  int x;
};

class AA:public A
{
public:
  using A::x;
};

class TT;

class T
{
public:
  class foo:public A // <<-- foo is the culprit!
  {
    friend class TT;
  };
protected:
  AA aa;
};

class TT:public T
{
public:
  void foo(){aa.x=0;}
};

int main()
{
}

This fails with

"ComeauTest.c", line 29: error: protected member "A::x" is not accessible through
a
          "AA" pointer or object
    void foo(){aa.x=0;}
                  ^

The error does not show if one of the two conditions hold (or both):

1. foo does not derive from A nor AA.
2. foo does not include the friend decl.

Seems like a genuine bug to me. Comments welcome.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk