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++/1876: class template within a namespace



>Number:         1876
>Category:       c++
>Synopsis:       class template within a namespace
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 05 10:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Kristopher Buschelman
>Release:        gcc version 2.95.2-6 19991024 (cygwin experimental)
>Organization:
>Environment:
cygwin
>Description:
g++ bar.cc

bar.cc:7: ANSI C++ forbids declaration `Point' with no type
>How-To-Repeat:
/* file: bar.cc */
namespace Name {
  template <class T> class Point;
}

template <class T> class Name::Point {
 public:
  Point() {}
 protected:
  T member;
};

int main(void) {
  Name::Point<double> d;
  return(0);
}
>Fix:
/* file: bar_fix.cc */

namespace Name {
  template <class T> class Point;
}

using Name::Point;

template <class T> class Point {
 public:
  Point() {}
 protected:
  T member;
};

int main(void) {
  Name::Point<double> d;
  return(0);
}
>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]