[Qt-creator] Problems using c++11 features

Wilhelm wilhelm.meier at fh-kl.de
Thu Apr 4 06:33:15 CEST 2013


Hi again,

(I write this as top-post because of something new)

besides the template-stuff (see below) a very annoying feature is the 
re-formating of the reference-symbol if function-definitions are added 
automatically:

a declaration of

Class& Class(const Class& other);

gives the definition

Class &Class(const Class &other)
{
}

An further more, rvalue-references are totally ignored:

a declaration of the move-ctor

Class& Class(Class&& other);

gives the definition

Class &Class(Class &other)
{
}

Are there any hidden "switches" that I'm not aware of?

-
Wilhelm

Am 03.04.2013 17:28, schrieb Orgad Shaneh:
> On Tue, Apr 2, 2013 at 12:49 PM, Prof. Dr.-Ing. Wilhelm Meier
> <wilhelm.meier at fh-kl.de <mailto:wilhelm.meier at fh-kl.de>> wrote:
>
>     Hi all,
>
>     in the following simple example (code and project settings below) using
>     c++11-features I heavily miss the autocompletion: the templates of
>     <memory> aren't autocompleted as well as the members of the
>     std::shared_ptr template and the pointed-to object.
>
>     I'm using qtcreator-2.7 and gcc-4.8.0.
>
>     Is there any chance to get this working?
>
>     ---------------
>
>     #include <memory>
>     #include <string>
>
>     class X
>     {
>     public:
>           inline std::string name() {
>               return mName;
>           }
>     private:
>           std::string mName;
>     };
>
>     int main()
>     {
>           // no completion for std::make_shared
>           auto p1 = std::make_shared<X>();
>           // no completion for member-function
>           p1->name();
>
>           // no completion for std::shared_ptr
>           std::shared_ptr<X> p2 = std::make_shared<X>();
>           // no completion for member-function
>           p2->name();
>     }
>
>     ----------------------
>
>     QT       += core
>     QT       -= gui
>
>     TARGET = l0002
>     CONFIG   += console
>     CONFIG   -= app_bundle
>
>     TEMPLATE = app
>
>     QMAKE_CXXFLAGS += -Wall -Wextra -std=c++11
>
>     SOURCES += main.cc
>
>     --
>     Wilhelm
>
>     _______________________________________________
>     Qt-creator mailing list
>     Qt-creator at qt-project.org <mailto:Qt-creator at qt-project.org>
>     http://lists.qt-project.org/mailman/listinfo/qt-creator
>
>
>
> Hi,
>
> Template problems (and almost any other code-model problems, at least
> the ones I report
> <https://bugreports.qt-project.org/secure/IssueNavigator.jspa?reset=true&jqlQuery=resolution+%3D+Unresolved+AND+reporter+%3D+orgads+AND+component+%3D+%22C%2FC%2B%2B%2FObj-C%2B%2B+Support%22>)
> tend to be ignored (i.e. not even evaluated).
>
> Przemyslaw is doing a great work
> <https://codereview.qt-project.org/#q,owner:przemyslaw,n,z> trying to
> fix them, but it is far from complete. There is an ongoing incomplete
> patch <https://codereview.qt-project.org/46622> that should fix
> completion for stl containers.
>
> - Orgad
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>


-- 
Wilhelm




More information about the Qt-creator mailing list