[Qt-creator] Supporting code completation for templated class with default template parameter type

Marco Bubke Marco.Bubke at qt.io
Thu Mar 14 14:22:37 CET 2019


Clang could explicitly instantiate the default time and use it for code completion but this has to be done in Clang. If you could provide a patch to Clang we would automatically use it. ;-)
________________________________
From: Qt-creator <qt-creator-bounces at qt-project.org> on behalf of علی موسوی <a.mosawi99 at mailfa.com>
Sent: Thursday, March 14, 2019 11:26 AM
To: qt-creator at qt-project.org
Subject: [Qt-creator] Supporting code completation for templated class with default template parameter type


suppouse following code



class AClass {

   int a;

};



template<typename T = AClass>

class BClass{

   BClass(){

      t.a = 0;  /* Code Completation should know the default T is AClass and show members of AClass */

   }

   T t;

};



When the the default type for T is specified, i think its possible and good to show members of default type (AClass) when writing t.

In QtCreators internal codemodel its possible and working as long as we name the template parameter T as AClass :

template<typename AClass>

....



but in clang code model this doesn't happen at all ( and i think its correct )

does the clang is correct and internal one is broken or clang lack of supporting something like this and internal one does?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20190314/daac9392/attachment.html>


More information about the Qt-creator mailing list