[Bug c++/28670] New: reject valid? conversion from ‘int’ to non-scalar type ‘Y’ requested.

pluto at agmk dot net gcc-bugzilla@gcc.gnu.org
Wed Aug 9 22:28:00 GMT 2006


struct X { X( int ); };
struct Y { Y( X const& ); };

void test()
{
    Y y1( 1 );  // conversion works fine.

    Y y2 = 2;   // error: conversion from ‘int’ to non-scalar
                // type ‘Y’ requested.
}

msvc accepts both variants, g++ only one.
is it a bug in g++ or in msvc?


-- 
           Summary: reject valid? conversion from ‘int’ to non-
                    scalar type ‘Y’ requested.
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
 GCC build triplet: x86-64-linux
  GCC host triplet: x86-64-linux
GCC target triplet: x86-64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28670



More information about the Gcc-bugs mailing list