c++/2208: Problem with g++ and templates

B.Touron@citb.bull.net B.Touron@citb.bull.net
Wed Mar 7 10:46:00 GMT 2001


>Number:         2208
>Category:       c++
>Synopsis:       Problem with g++ and templates
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 07 10:46:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Benoit Touron
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
UnixWare bdsdev 5 7.1.0 i386 x86at SCO UNIX_SVR5
(result of uname -a)
>Description:
This program does not compile
--> START

template<class BASE_CLASS>
class myclass : public BASE_CLASS
{
public:
  void fun(BASE_CLASS::mytype p)  // GOT " parse error 
                                  //       before `)'"
    { return; }
};
void main()
{
}

<-- END

BASE_CLASS is supposed to have type "mytype"
defined inside it (and public).
This file compiles OK with MS compiler.
>How-To-Repeat:
g++ -c test.cc
>Fix:

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



More information about the Gcc-bugs mailing list