[LLVMbugs] [Bug 18226] New: invalid 'use of class template %s requires template arguments'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 12 05:33:06 PST 2013


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

            Bug ID: 18226
           Summary: invalid 'use of class template %s requires template
                    arguments'
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vanyacpp at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

On the following code clang gives error:

1.cpp:16:26: error: use of class template y requires template arguments
     friend void x<U>::f(y);
                         ^
But gcc and msvc compiles this code without any error.

template <typename U>
struct y;

template <typename T>
struct x
{
    void f(y<T> a)
    {
        a.a = 5;
    }
};

template <typename U>
struct y
{
     friend void x<U>::f(y); // error here

private:
     int a;
};

int main()
{
    x<int>().f(y<int>());
}

-- 
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/20131212/f7be56ea/attachment.html>


More information about the llvm-bugs mailing list