[llvm-bugs] [Bug 31647] New: Clang-cl: conversion from 'long' to 'const QVariant' is ambiguous

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 15 07:57:30 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31647

            Bug ID: 31647
           Summary: Clang-cl: conversion from 'long' to 'const QVariant'
                    is ambiguous
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jvapen at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17843
  --> https://llvm.org/bugs/attachment.cgi?id=17843&action=edit
Reproduction

The attachment contains a smaller reproduction scenario.
Problem occurred during conversion of MSVC codebase with Qt to clang-cl. (More
specially with the QVariant)
Using clang-cl from SVN r291454 (9 January 2017) (64 bit version from
http://llvm.org/builds/)

namespace {
    struct A {
        A(int) {}
        A(unsigned int) {}
        A(long long) {}
        A(unsigned long long) {}
        A(bool) {}
        A(float) {}
        A(double) {}
    };
    long getLong() { return 42; }
    void f(const A &) {}
}

int main(int, char **)
{
    f(getLong());
    return 0;
}

> Calling f is ambiguous


However, if I change the main function to the following, clang-cl compiles the
code.

int main(int, char **)
{
        long l = 42;
    f(l);
    return 0;
}

MSVC compiles both versions of the code.

I've also checked with:
static_assert(sizeof(int) == sizeof(long), "We expect int to be the same size
as long");
In both compilers, this assert evaluates to true.

-- 
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/20170115/b0425466/attachment.html>


More information about the llvm-bugs mailing list