[LLVMbugs] [Bug 12328] New: Friend method declaration doesn't require method to be visible

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 22 07:56:38 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=12328

             Bug #: 12328
           Summary: Friend method declaration doesn't require method to be
                    visible
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bauerb at chromium.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This code:

class X {
  void f();
};

class Y {
  friend void X::f();
};

compiles on Clang (151385), but doesn't on GCC or Visual Studio (because X::f
is not visible to Y). Also, C++98 [class.friend]p7 says: "A name nominated by a
friend declaration shall be accessible in the scope of the class containing the
friend declaration."

-- 
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