From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7418 invoked by alias); 22 Dec 2009 18:05:59 -0000 Received: (qmail 7243 invoked by uid 48); 22 Dec 2009 18:05:47 -0000 Date: Tue, 22 Dec 2009 18:05:00 -0000 Subject: [Bug c++/42466] New: Multiple instantiations of template constructor fail X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "apatterno at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg02148.txt.bz2 The test code: template struct A { IntT val_; A() : val_(X) {} A(IntT arg) : val_(arg) {} template A(const A& other) : val_(other.val_) {} }; int main(int argc, char** argv) { A a; A b = a; A c; A d = c; A e; A f = e; } fails to compile on gcc 4.3.2: case.cpp: In function 'int main(int, char**)': case.cpp:19: error: conversion from 'A' to non-scalar type 'A' requested case.cpp:22: error: conversion from 'A' to non-scalar type 'A' requested The first conversion is OK, but the other two conversions are being flagged as errors. Even if I were to put the conversions in a different order, the same results... first one is OK, other two fail. -- Summary: Multiple instantiations of template constructor fail Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: apatterno at gmail dot com GCC build triplet: i686-pc-cygwin GCC host triplet: i686-pc-cygwin GCC target triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42466