From 06dc126d7c03999af10858691f73500116cd344f Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Mon, 7 May 2012 15:58:15 +0200 Subject: [PATCH] FindExportsVisitor: qmlRegisterType qmlRegisterType can also have 2 template arguments i.e. the metaRevisionNumber. Consider the case when parsing exported types. Change-Id: I553f0e361cc9e9c5a88becd50fd72a33cd35a0d1 Reviewed-by: Fawzi Mohamed --- .../qmljstools/qmljsfindexportedcpptypes.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp index 07d459334f9..ef6d0140820 100644 --- a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp +++ b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp @@ -151,10 +151,21 @@ protected: else return false; - // must have a single typeid template argument - if (!templateId->template_argument_list || !templateId->template_argument_list->value - || templateId->template_argument_list->next) + // check that there is a typeId + if (!templateId->template_argument_list || !templateId->template_argument_list->value) return false; + // sometimes there can be a second argument, the metaRevisionNumber + if (templateId->template_argument_list->next) { + if (!templateId->template_argument_list->next->value || + templateId->template_argument_list->next->next) + return false; + // should just check for a generic ExpressionAST? + NumericLiteralAST *metaRevision = + templateId->template_argument_list->next->value->asNumericLiteral(); + if (!metaRevision) + return false; + } + TypeIdAST *typeId = templateId->template_argument_list->value->asTypeId(); if (!typeId) return false;