[Bug c++/14878] New: Fails to parse call to template function

v dot lesk at imperial dot ac dot uk gcc-bugzilla@gcc.gnu.org
Wed Apr 7 14:30:00 GMT 2004


#include<iostream>

using namespace std;


class A
{
public:
  template<typename T>
  T f(void){T result = 0; return result;}
};

template<typename T>
class B
{
public:
  T g(void){A a;return a.f<T>();}           // this line is changed
};


int main(void)
{
  B<int>b;
  cout<<b.g()<<endl;

  return 0;
}

//Error:
//a.C: In member function `T B<T>::g()':
//a.C:17: error: parse error before `;' token

-- 
           Summary: Fails to parse call to template function
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: v dot lesk at imperial dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14878



More information about the Gcc-bugs mailing list