vendredi 27 mai 2016

C++ strange namespace lookup behavior [duplicate]

This question already has an answer here:

namespace fooo {
  class Fooo {
  public:
    int a;
  };
}

namespace fooo {
  class Test {
  public:
    Test(Fooo::Fooo *i) {
      i->a = 1;
    }
  };
}

This code compiles fine with clang (any version) but fails with gcc. Can anyone explain why?

EDIT: Yes, I know the issue here is kinda obvious but why does clang accept it? The person who told me this said that this is a bug in the standard and that there is a Defect Report. Can anyone point to the actual DR?

Aucun commentaire:

Enregistrer un commentaire