From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20729 invoked by alias); 21 Mar 2003 23:24:54 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 20704 invoked by uid 48); 21 Mar 2003 23:24:53 -0000 Date: Fri, 21 Mar 2003 23:24:00 -0000 Message-ID: <20030321232453.20703.qmail@sources.redhat.com> To: bsamwel@xs4all.nl, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jtv@xs4all.nl, bsamwel@xs4all.nl, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, bsamwel@xs4all.nl, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jtv@xs4all.nl, bsamwel@xs4all.nl, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/10187: string literal converted to non-const `char[]' when used as argument to function template X-SW-Source: 2003-03/txt/msg01424.txt.bz2 List-Id: Synopsis: string literal converted to non-const `char[]' when used as argument to function template State-Changed-From-To: open->closed State-Changed-By: bangerth State-Changed-When: Fri Mar 21 23:24:53 2003 State-Changed-Why: By 2.13.4.1, An ordinary string literal has type "array of n const char" and static storage duration (_basic.stc_), where n is the size of the string as defined below, and is initialized with the given characters. To get the effect you want, declare a function template int foo (const char (&x)[N]) {} http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10187