[LLVMbugs] [Bug 20259] New: Friend lookup works differently in ms mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 9 11:24:20 PDT 2014


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

            Bug ID: 20259
           Summary: Friend lookup works differently in ms mode
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider:

class FriendClass;
namespace inner {
template <typename T> class Cont {
public:
  friend class FriendClass;

protected:
  explicit Cont(T s) throw() {}
};
}
class FriendClass {
public:
  typedef inner::Cont<int> C;

  static C foo() throw() { return C(0); }
};

cl.exe builds this fine. Clang complains

hummer:clang thakis$ ~/src/llvm-build/bin/clang-cl  /c test.cc
test.cc(15,35) :  error: calling a protected constructor of class
'inner::Cont<int>'
  static C foo() throw() { return C(0); }
                                  ^
test.cc(8,12) :  note: declared protected here
  explicit Cont(T s) throw() {}
           ^
1 error generated.


The friend apparently does an unqualified lookup in cl apparently. (This is
reduced from a wrl header used in chromium)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140709/159967e4/attachment.html>


More information about the llvm-bugs mailing list