The following small test case causes GCC to ICE:

struct A;

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

struct A
{
  A(B) {}
};

B f(A const &a) { return B(a); }


Same result (ICE) on the following two systems:

gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51)


If the "explicit" keyword is dropped the ICE disappears. The same is true if
the argument to A's constructor is changed to an reference.


-- 
           Summary: ICE with explicit copy constructor
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kristian dot spangsege at gmail dot com
 GCC build triplet: 4.1.2
  GCC host triplet: 4.1.2
GCC target triplet: 4.1.2


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

Reply via email to