From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11978 invoked by alias); 14 Jul 2011 16:05:07 -0000 Received: (qmail 11961 invoked by uid 22791); 14 Jul 2011 16:05:06 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Jul 2011 16:04:52 +0000 From: "ville.voutilainen at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/41426] User defined conversion on return ignores array types X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ville.voutilainen at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Thu, 14 Jul 2011 16:05:00 -0000 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: 2011-07/txt/msg01130.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D41426 Ville Voutilainen changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ville.voutilainen at gmail | |dot com --- Comment #1 from Ville Voutilainen = 2011-07-14 16:04:11 UTC --- gcc 4.7 (trunk) still behaves this way. An example snippet was provided for me: struct v { template v( const char(&)[N] ){} }; v foo( ) { return "Hello WOrld"; // #1 } int main ( ) { v x("hello world"); // #2 } in that snippet, #1 is rejected with error: could not convert =E2=80=98(const char*)"Hello WOrld"=E2=80=99 from = =E2=80=98const char*=E2=80=99 to =E2=80=98v=E2=80=99 Explicit construction of v in foo() works.