[LLVMbugs] [Bug 8182] New: wrong constructor choice (templates)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 18 15:28:33 PDT 2010


           Summary: wrong constructor choice (templates)
           Product: clang
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: muravev at yandex.ru
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Clang 2.8 (r114073) refuses to compile the code:

struct foo {

    foo() {}

    template<class T>

    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.

More information about the llvm-bugs mailing list