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

           Summary: Friend declaration is ignored
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


The following code snippet (which works for GCC 4.5 and VC 7):

functor.cc:

template <class T>
struct Functor {
};

class Class {
    struct Inner {
        int a_;
    };

    friend struct Functor<Inner>;
};

template <>
struct Functor<Class::Inner> {
    int operator() (Class::Inner const & key) const
    {
        return key.a_;
    }
};


yields:

functor.cc:14:23: error: 'Inner' is a private member of 'Class'
struct Functor<Class::Inner> {
                      ^
functor.cc:6:12: note: declared private here
    struct Inner {
           ^
1 error generated.

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

Reply via email to