This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/8109: static member const used in non-type template parameter


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]