This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17238] New: explicit qualification of member template is rejected
- From: "philippe dot haution at mines-paris dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Aug 2004 11:20:52 -0000
- Subject: [Bug c++/17238] New: explicit qualification of member template is rejected
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The instantiation of member templates must be explicitly qualified when the
actual type cannot be infered from the arguments. This used to work OK with gcc
3.2.2 but the hereunder test case now fails to compile.
> gcc pbTemplate.cc -o pbTemplate
error: `template' (as a disambiguator) is only allowed within templates
#include <vector>
#include <string>
using std::vector;
using std::auto_ptr;
using std::string;
namespace BD {
class Tst
{
public:
Tst()
{}
~Tst()
{}
template <typename T>
auto_ptr<vector<T> >
lire()
{
//cout << "methode generique" << endl;
auto_ptr<vector<T> > res(new vector<T>);
return res;
}
};
}
int main(int argc, char **argv)
{
BD::Tst t;
vector<string>& res1 = *t.template lire<string>();
}
--
Summary: explicit qualification of member template is rejected
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: philippe dot haution at mines-paris dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17238