This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1876: class template within a namespace
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1876: class template within a namespace
- From: buschelm at mcs dot anl dot gov
- Date: 5 Feb 2001 18:13:48 -0000
- Reply-To: buschelm at mcs dot anl dot gov
>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: