Topic: Defect Report: Fully qualified friend declarations ill-formed


Author: loewis@informatik.hu-berlin.de (Martin von Loewis)
Date: 1999/06/07
Raw View
[ Moderator's note: Forwarded to C++ Committee -sdc ]

This example is ill-formed due to an omission.

namespace A{
  class B{};
};

namespace B{
  class A{};
  class C{
    friend class ::A::B;
  };
};

According to 7.1.5.3, [dcl.type.elab]/1, the friend declaration is
ill-formed: The elaborated type specified (class ::A::B) is the sole
constituent of the declaration, but it has none of the listed forms.

Proposed resolution: Add

   friend class   key ::nested   name   specifier identifier ;

to the list of acceptable exceptions.

Please let me know if you need further information.

Regards,
Martin v. L   wis


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]