[LLVMbugs] [Bug 8705] New: clang doesn't handle friend member functions correctly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 29 20:19:06 PST 2010


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

           Summary: clang doesn't handle friend member functions correctly
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


gcc 4.2 accepts the following program:

class B {
 public:
  void b(int a);
  void c(int a);
};

class A {
 private:
  static int a();
  friend void B::c(int);
};

//void B::b(int a = A::a()) {}  // Should error
void B::c(int a = A::a()) {}

clang rejects it with

test.cc:14:22: error: 'a' is a private member of 'A'
void B::c(int a = A::a()) {}
                     ^
test.cc:9:14: note: declared private here
  static int a();
             ^
1 error generated.

(Reverting r120299 does not make this go away.)

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