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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to