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: unassignedclangb...@nondot.org Reporter: jva...@gmail.com CC: llvm-bugs@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.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs