<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Clang-cl: conversion from 'long' to 'const QVariant' is ambiguous"
   href="https://llvm.org/bugs/show_bug.cgi?id=31647">31647</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-cl: conversion from 'long' to 'const QVariant' is ambiguous
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jvapen@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17843" name="attach_17843" title="Reproduction">attachment 17843</a> <a href="attachment.cgi?id=17843&action=edit" title="Reproduction">[details]</a></span>
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
<a href="http://llvm.org/builds/">http://llvm.org/builds/</a>)

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

<span class="quote">> Calling f is ambiguous</span >


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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>