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

           Summary: wrong constructor choice (templates)
           Product: clang
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Clang 2.8 (r114073) refuses to compile the code:

struct foo {

    foo() {}

    template<class T>
    foo(T&)
    {}

    private:
    foo(const foo&);
};

int main()
{
    foo f1;
    foo f2(f1); // error: calling a private constructor of class 'foo'

    return 0;
}

But gcc (4.2, 4.5), comeau compilers and I think this is good code; and the
reason is described in C++98 standard, 13.3.1 clause 7.

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