C++ expected primary-expression error
<p>I got a 'expected primary-expression before 'int'' error when compiling with g++ the following code. Do you know why and how to fix it ? Thank you !</p>

<pre><code> struct A
 {
     template &lt;typename T&gt;
     T bar() { T t; return t;}
 };

 struct B : A
 {
 };

 template &lt;typename T&gt;
 void foo(T  &amp; t)
 {
     t.bar&lt;int&gt;();
 }

 int main()
 {
     B b;
     foo(b);
 }
</code></pre>
