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

           Summary: non-sfinae error: is a private member
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Hello,

when I compile this code:

class A { typedef int priv; };
void f(A,A){}
template <class T> void f(T,typename T::priv){}
void g(){f(A(),A());}

I get the error:

h.C:3:41: error: 'priv' is a private member of 'A'
template <class T> void f(T,typename T::priv){}
                                        ^
h.C:3:25: note: while substituting deduced template arguments into function
      template 'f' [with T = A]
template <class T> void f(T,typename T::priv){}
                        ^

First, I am not sure whether this is supposed to be an error (it is certainly
painful if it is).

Second, in any case, the error message is missing a crucial piece of
information which is where the function was called from (line 4). Is there some
option to make it appear? I understand that quite often the instantiation
context is spam in the error message, but here it would help.

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