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++/1756: template in private causes confusion



>Number:         1756
>Category:       c++
>Synopsis:       template in private causes confusion
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 24 02:16:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     hamid.kharraziha@carmen.se
>Release:        gcc version 2.95.1 19990816 (release)
>Organization:
>Environment:
/opt/gnu/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.1/specs
>Description:
g++ -Wall    -c main.cc -o main.o
main.cc: In instantiation of `KSP<int>':
main.cc:34:   instantiated from here
main.cc:34: Internal compiler error.
main.cc:34: Please submit a full bug report.
main.cc:34: See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
make: *** [main.o] Error 1
>How-To-Repeat:
template< class T> 
class KSP
{
public:
  KSP();

private:

  template< class>
  class map;

  map< T*>& bnodes;
};

int main(int argc, char* argv[])
{
  KSP<int> hej;
  return 0;
}
>Fix:
Fix 1:
template< class T1>
class map;

Fix 2:
Put it above the KSP class definition.
>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]