diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index a125683aff2602ec89ad459457007dadce6facdd..f323241a1877bd50d0afaece684ca67d799bb2ea 100644
--- a/src/shared/cplusplus/Parser.cpp
+++ b/src/shared/cplusplus/Parser.cpp
@@ -1568,10 +1568,26 @@ bool Parser::parseTemplateTypeParameter(DeclarationAST *&node)
     return false;
 }
 
+bool Parser::lookAtTypeParameter() const
+{
+    if ((LA() == T_CLASS || LA() == T_TYPENAME) && LA(2) == T_IDENTIFIER) {
+        switch (LA(3)) {
+        case T_EQUAL:
+        case T_COMMA:
+        case T_GREATER:
+            return true;
+        }
+    }
+
+    return false;
+}
+
+
 bool Parser::parseTypeParameter(DeclarationAST *&node)
 {
     DEBUG_THIS_RULE();
-    if (LA() == T_CLASS || LA() == T_TYPENAME)
+
+    if (lookAtTypeParameter())
         return parseTypenameTypeParameter(node);
     else if (LA() == T_TEMPLATE)
         return parseTemplateTypeParameter(node);
diff --git a/src/shared/cplusplus/Parser.h b/src/shared/cplusplus/Parser.h
index ff546cada917b61e847ae7ff2deea2d6e0103017..4ff708b1cc633f6727b319402b5e78e9617e393b 100644
--- a/src/shared/cplusplus/Parser.h
+++ b/src/shared/cplusplus/Parser.h
@@ -280,6 +280,7 @@ public:
     bool skipUntilStatement();
     bool skip(int l, int r);
 
+    bool lookAtTypeParameter() const;
     bool lookAtCVQualifier() const;
     bool lookAtFunctionSpecifier() const;
     bool lookAtStorageClassSpecifier() const;