Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]

Tags:

c++

c++11

qt

c++14

qt5

I'm using Qt5 with Clang on Debian Jessie. To experiment with generic lambdas, in the .pro file there is:

CONFIG += c++14

And after building I got:

warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]

To get rid of this obvious message I did:

QMAKE_CXXFLAGS += -Wc++11-extensions

But I keep getting the obvious message. Why? How to hide it?

like image 448
KcFnMi Avatar asked May 01 '16 02:05

KcFnMi


1 Answers

According to qmake's repository history, the CONFIG += c++14 stanza was added in qmake version 5.4: https://codereview.qt-project.org/#/c/87831/

However, it seems Debian Jessie only has qmake version 5.3 (https://packages.debian.org/jessie/qt5-qmake)

As a workaround, you can use

QMAKE_CXXFLAGS += -std=c++14

or

QMAKE_CXXFLAGS += -std=gnu++14
like image 101
Johan Boulé Avatar answered Sep 30 '22 14:09

Johan Boulé