From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16940 invoked by alias); 29 Apr 2003 16:37:31 -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 16921 invoked by uid 48); 29 Apr 2003 16:37:30 -0000 Date: Tue, 29 Apr 2003 16:37:00 -0000 Message-ID: <20030429163730.16920.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gianni@mariani.ws, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gianni@mariani.ws, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/10541: Is NULL a valid pointer-type template argument? X-SW-Source: 2003-04/txt/msg01351.txt.bz2 List-Id: Old Synopsis: template does not work New Synopsis: Is NULL a valid pointer-type template argument? State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue Apr 29 16:37:30 2003 State-Changed-Why: Your first case is invalid, since 0 is of type int, but a char* is required. The last one is also invalid, since the address of an object with external linkage is required, but you give the value of a member variable. Remains the question whether -------------------- template class T {}; T(0)> t; -------------------------- is legal. I tend to think that this is not so (but icc7 disagrees with me), given 14.1.3: 3 A non-type template-parameter shall have one of the following (option- ally cv-qualified) types: [...] --pointer to object, accepting an address constant expression desig- nating a named object with external linkage, The NULL pointer is certainly not the address of a named object, but I can see why it would be useful to allow this special case. I leave this last question to more seasoned language lawyers. W. but http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10541