public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17238] New: explicit qualification of member template is rejected
@ 2004-08-30 11:20 philippe dot haution at mines-paris dot org
  2004-08-30 11:37 ` [Bug c++/17238] " bangerth at dealii dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: philippe dot haution at mines-paris dot org @ 2004-08-30 11:20 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-30 19:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-30 11:20 [Bug c++/17238] New: explicit qualification of member template is rejected philippe dot haution at mines-paris dot org
2004-08-30 11:37 ` [Bug c++/17238] " bangerth at dealii dot org
2004-08-30 12:28 ` philippe dot haution at mines-paris dot org
2004-08-30 15:58 ` bangerth at dealii dot org
2004-08-30 18:48 ` philippe dot haution at mines-paris dot org
2004-08-30 19:53 ` bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).