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]

c++/2668: failure to match template member array definition with declaration



>Number:         2668
>Category:       c++
>Synopsis:       failure to match template member array definition with declaration
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 27 09:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jens Maurer
>Release:        gcc version 3.0 20010425 (prerelease)
>Organization:
>Environment:
Linux 2.4.3 on x86, glibc 2.2.2
>Description:
gcc fails to match the (required) definition of the
static member with its declaration.
Also happens (same error) on gcc 2.95.3 and
gcc version 3.1 20010425 (experimental)

template-vector-match.cc:8: conflicting types for `T S<T>::a[256]'
template-vector-match.cc:4: previous declaration as `T S<T>::a[(1 << 8)]'
>How-To-Repeat:
template<class T>
struct S {
  static T a[1 << 8];
};

template<class T>
T S<T>::a[1 << 8];

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