[LLVMbugs] [Bug 14486] New: Wrong constructor is selected in templated class.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 3 05:59:12 PST 2012


             Bug #: 14486
           Summary: Wrong constructor is selected in templated class.
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dummymail000 at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code:

struct QBasicAtomicInteger
    QBasicAtomicInteger(int value)   {}
    QBasicAtomicInteger(const QBasicAtomicInteger &) = delete;

template<typename T>
struct QMetaTypeIdQObject
    static int qt_metatype_id()
        static QBasicAtomicInteger metatype_id = { 0 };
        return 0;

int main()
    return QMetaTypeIdQObject<int>::qt_metatype_id();

Does not compile with error:

main.cpp|13 col 36 error| copying variable of type 'QBasicAtomicInteger'
invokes deleted constructor

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