public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: benko@sztaki.hu
To: gcc-gnats@gcc.gnu.org
Subject: c++/8109: static member const used in non-type template parameter
Date: Tue, 01 Oct 2002 08:26:00 -0000	[thread overview]
Message-ID: <20021001152113.4945.qmail@sources.redhat.com> (raw)


>Number:         8109
>Category:       c++
>Synopsis:       static member const used in non-type template parameter
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 01 08:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     benko@sztaki.hu
>Release:        3.2
>Organization:
>Environment:
Linux arta 2.4.18 #2 Thu Feb 28 19:27:45 CET 2002 i686 unknown
>Description:
Compiling the following program

arta:~/c/proba$ cat static_member.cc
template <int i>
struct c
{};

template <typename T>
struct a
{
  static int const i = 0;

  void f(c<i>);
};

template <typename T>
void
a<T>::f(c<i>)
{}
arta:~/c/proba$ 

gives

arta:~/c/proba$ g++3 -c -W -Wall -ansi -pedantic static_member.cc 
static_member.cc:16: prototype for `void a<T>::f(c<a<T>::i>)' does not match 
   any in class `a<T>'
static_member.cc:10: candidate is: void a<T>::f(c<a<T>::i>)
static_member.cc:16: template definition of non-template `void 
   a<T>::f(c<a<T>::i>)'
zsh: exit 1     g++3 -c -W -Wall -ansi -pedantic static_member.cc
arta:~/c/proba$ 

Of course, it can be "fixed" by an inline definition of f.

Thank you,
Pal Benko
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-10-01 15:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-01  8:26 benko [this message]
2002-10-01  9:36 Wolfgang Bangerth
2002-10-04  8:12 lerdsuwa
2003-05-04 20:41 giovannibajo

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=20021001152113.4945.qmail@sources.redhat.com \
    --to=benko@sztaki.hu \
    --cc=gcc-gnats@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: link
Be 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).