public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: bangerth@dealii.org To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gianni@mariani.ws, nobody@gcc.gnu.org Subject: Re: c++/10541: Is NULL a valid pointer-type template argument? Date: Tue, 29 Apr 2003 16:37:00 -0000 [thread overview] Message-ID: <20030429163730.16920.qmail@sources.redhat.com> (raw) Old Synopsis: template <char * w_val > 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 <char *> class T {}; T<static_cast<char *>(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
next reply other threads:[~2003-04-29 16:37 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-04-29 16:37 bangerth [this message] 2003-04-29 17:16 Martin Sebor 2003-04-29 17:26 Wolfgang Bangerth 2003-04-29 17:26 Wolfgang Bangerth 2003-04-29 17:26 Gianni Mariani 2003-04-29 17:56 Gianni Mariani
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030429163730.16920.qmail@sources.redhat.com \ --to=bangerth@dealii.org \ --cc=gcc-bugs@gcc.gnu.org \ --cc=gcc-gnats@gcc.gnu.org \ --cc=gcc-prs@gcc.gnu.org \ --cc=gianni@mariani.ws \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).