diff --git a/src/shared/cplusplus/AST.h b/src/shared/cplusplus/AST.h
index 47342c2e04554e9d649b2303ab0ceaf87eb92f5e..f21d9042fd46177307ef8d6d66228c386db1237a 100644
--- a/src/shared/cplusplus/AST.h
+++ b/src/shared/cplusplus/AST.h
@@ -2083,7 +2083,7 @@ public:
     ExpressionAST *type_id;
 
 public: // annotations
-    Argument *symbol;
+    TypenameArgument *symbol;
 
 public:
     virtual TypenameTypeParameterAST *asTypenameTypeParameter() { return this; }
@@ -2109,7 +2109,7 @@ public:
     ExpressionAST *type_id;
 
 public:
-    Argument *symbol;
+    TypenameArgument *symbol;
 
 public:
     virtual TemplateTypeParameterAST *asTemplateTypeParameter() { return this; }
diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp
index 3349263e1eb4a5aca6908c3cd21de353ebdbd858..719a0c82eb40ac92be31846e84d292de9cf338be 100644
--- a/src/shared/cplusplus/CheckDeclaration.cpp
+++ b/src/shared/cplusplus/CheckDeclaration.cpp
@@ -459,7 +459,9 @@ bool CheckDeclaration::visit(TypenameTypeParameterAST *ast)
         sourceLocation = ast->name->firstToken();
 
     const Name *name = semantic()->check(ast->name, _scope);
-    Argument *arg = control()->newArgument(sourceLocation, name); // ### new template type
+    TypenameArgument *arg = control()->newTypenameArgument(sourceLocation, name);
+    FullySpecifiedType ty = semantic()->check(ast->type_id, _scope);
+    arg->setType(ty);
     ast->symbol = arg;
     _scope->enterSymbol(arg);
     return false;
@@ -472,7 +474,9 @@ bool CheckDeclaration::visit(TemplateTypeParameterAST *ast)
         sourceLocation = ast->name->firstToken();
 
     const Name *name = semantic()->check(ast->name, _scope);
-    Argument *arg = control()->newArgument(sourceLocation, name); // ### new template type
+    TypenameArgument *arg = control()->newTypenameArgument(sourceLocation, name);
+    FullySpecifiedType ty = semantic()->check(ast->type_id, _scope);
+    arg->setType(ty);
     ast->symbol = arg;
     _scope->enterSymbol(arg);
     return false;