Bug 14878 - Fails to parse call to template function
Summary: Fails to parse call to template function
Status: RESOLVED DUPLICATE of bug 795
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-07 14:30 UTC by v.lesk@imperial.ac.uk
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description v.lesk@imperial.ac.uk 2004-04-07 14:30:18 UTC
#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
Comment 1 Andrew Pinski 2004-04-07 15:02:34 UTC
This is a dup of one of the most reported bugs, PR 795.  This is fixed in 3.4.0 already (which is going to 
be released in the next few weeks).

*** This bug has been marked as a duplicate of 795 ***