[LLVMbugs] [Bug 13642] New: friends mistake

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Aug 19 12:55:02 PDT 2012


             Bug #: 13642
           Summary: friends mistake
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rkotler at mips.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

#include <stdio.h>
class A {
  //friend void c();
  class B {
    static int i;
    friend void c();

void c() {
  printf("%i \n", A::B::i);

I believe that this should be illegal. g++ says it's illegal but Clang allows
If you uncomment the friend C definition in at the beginning of class A, then
g++ allows it.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list