expected primary-expression before ‘>’ token
<p>I have a code like:</p>

<pre><code>class Client2ServerProtocol {

};

class ProtocolHelper {
public:
    template&lt;class ProtocolClass&gt;
    int GetProtocolId() {
        return -1;
    }
};

template&lt;&gt; inline int
ProtocolHelper::GetProtocolId&lt;Client2ServerProtocol&gt;() {
    return 1;
}

template&lt;typename PROTOCOL_HELPER&gt;
class Dispatcher {
public:
    template&lt;typename PROTOCOL_CLASS&gt;
    void Subscribe(int msgId) {
        int protoId = helper.GetProtocolId&lt;PROTOCOL_CLASS&gt;();
        printf("Subscribe protoId %d, msgId %d", protoId, msgId);
    }
    PROTOCOL_HELPER helper;
};

int main() {
    Dispatcher&lt;ProtocolHelper&gt; dispatcher;
    dispatcher.Subscribe&lt;Client2ServerProtocol&gt;(1);
    return 0;
}
</code></pre>

<p>It compiles successfully (and works) under MSVC, but gcc is complaining about invalid syntax:</p>

<blockquote>
  <p>test.cc:23:56: error: expected primary-expression before ‘>’ token
         int protoId = helper.GetProtocolId();</p>
  
  <p>test.cc:23:58: error: expected primary-expression before ‘)’ token</p>
</blockquote>

<p>What i'm doing wrong?
       int protoId = helper.GetProtocolId();</p>