c++/1876: class template within a namespace
buschelm@mcs.anl.gov
buschelm@mcs.anl.gov
Mon Feb 5 10:16:00 GMT 2001
>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:
More information about the Gcc-bugs
mailing list