/*
In the code snippet below the definition of foo fails with the following error
foo.cc:11: error: expected constructor, destructor, or type conversion before
A
But the definition of foo2 triggers no error. I think both should be compiled
but it might be a language idiosyncrasy. Thanks.
*/
template <typename T>
class A
{
public:
typedef int blah;
blah foo();
blah foo2();
};
template <typename T>
A<T>::blah A<T>::foo()
{
return 0;
}
template <typename T>
A<int>::blah A<T>::foo2()
{
return 1;
}
--
Summary: Compile error about using typedefs defined in a template
class
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peaceout2324 at yahoo dot com
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28540