Package: gcc-snapshot
Version: 20070829-1
Severity: normal

The following code compiles with g++ 4.2 but fails with "ISO C++ says
that these are ambiguous, even though the worst conversion for the
first is better than the worst conversion for the second" when
compiling with latest gcc-snapshot. If I remove the QString include it
compiles with gcc-snapshot.

// Flags needed: -I/usr/include/qt4/ -lQtCore
#include <QtCore/QString>
#include <QtCore/QByteArray>

int main()
{
  if (QByteArray() == QByteArray())
    return 1;
  return 0;
}


Below is a simpler example that illustrates the same problem.

struct A {
  A(const struct B&) {}
};

struct B {
  bool operator==(const A&) const { return true; }
};

bool operator==(const B&, const B&) {
  return false;
}

int main()
{
  if (B() == B())
    return 1;
  return 0;
}


Is this a regression in gcc or is it something that must be fixed by
making A's constructor explicit?

// Erik

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-1-k7 (SMP w/1 CPU core)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gcc-snapshot depends on:
ii  binutils                2.18-1           The GNU assembler, linker and bina
ii  lib64gcc1               1:4.2.1-4        GCC support library (64bit)
ii  libasound2              1.0.14a-2        ALSA library
ii  libatk1.0-0             1.18.0-2         The ATK accessibility toolkit
ii  libc6                   2.6.1-1+b1       GNU C Library: Shared libraries
ii  libc6-amd64             2.6.1-1+b1       GNU C Library: 64bit Shared librar
ii  libc6-dev               2.6.1-1+b1       GNU C Library: Development Librari
ii  libcairo2               1.4.10-1         The Cairo 2D vector graphics libra
ii  libfontconfig1          2.4.2-1.2        generic font configuration library
ii  libfreetype6            2.3.5-1+b1       FreeType 2 font engine, shared lib
ii  libgcc1                 1:4.2.1-4        GCC support library
ii  libgcj-bc               4.2.1-4          Link time only library for use wit
ii  libglib2.0-0            2.14.0-2         The GLib library of C routines
ii  libgmp3c2               2:4.2.1+dfsg-5   Multiprecision arithmetic library
ii  libgtk2.0-0             2.10.13-1        The GTK+ graphical user interface 
ii  libice6                 2:1.0.4-1        X11 Inter-Client Exchange library
ii  libmpfr1ldbl            2.3.0.dfsg.1-2   multiple precision floating-point 
ii  libpango1.0-0           1.16.5-1         Layout and rendering of internatio
ii  libpng12-0              1.2.15~beta5-2   PNG library - runtime
ii  libsm6                  2:1.0.3-1+b1     X11 Session Management library
ii  libx11-6                2:1.0.3-7        X11 client-side library
ii  libxcursor1             1:1.1.9-1        X cursor management library
ii  libxext6                1:1.0.3-2        X11 miscellaneous extension librar
ii  libxfixes3              1:4.0.3-2        X11 miscellaneous 'fixes' extensio
ii  libxi6                  2:1.1.2-1        X11 Input extension library
ii  libxinerama1            1:1.0.2-1        X11 Xinerama extension library
ii  libxrandr2              2:1.2.1-1        X11 RandR extension library
ii  libxrender1             1:0.9.3-1        X Rendering Extension client libra
ii  libxtst6                2:1.0.3-1        X11 Testing -- Resource extension 
ii  zlib1g                  1:1.2.3.3.dfsg-5 compression library - runtime

gcc-snapshot recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to