When building Grantlee on Gentoo Linux with GCC 8.2 and Qt -dev branch (5.13 pre), Grantlee fails to build due to an incomplete type error in templates/lib/lexer_p.h. See below.
I'm not precisely sure why this would have worked before because lexer_p.h seems to be using enough of the Lexer class in some of the defined functions to have warranted requiring a complete type definition for QList early. Possibly older Qt headers had included QList already somehow and they managed to clean it up?
Either way I'll have a PR submitted if you want or you can just fix a different way, it's up to you.
--- (gcc -v)
...
gcc version 8.2.0 (Gentoo 8.2.0-r5 p1.6)
--- (qmake -v)
QMake version 3.1
Using Qt version 5.13.0 in /home/kde-svn/qt5/lib
--- (error log)
# kdesrc-build running: '/usr/bin/ninja' '-j17' # from directory: /kdesrc/build/kf5/grantlee [1/135] Automatic MOC for target Grantlee_Templates [2/135] Automatic MOC for target textdocument_test_builtins [3/134] Automatic MOC for target Grantlee_TextDocument
[4/133] Automatic MOC for target myplugin
[5/132] Automatic MOC for target main_app
[6/131] Automatic MOC for target template_test_builtins
[7/130] Building CXX object templates/lib/CMakeFiles/Grantlee_Templates.dir/lexer.cpp.o
FAILED: templates/lib/CMakeFiles/Grantlee_Templates.dir/lexer.cpp.o
/usr/lib/ccache/bin/c++ -DGrantlee_Templates_EXPORTS -DPLUGINS_PREFER_DEBUG_POSTFIX=0 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING -DQT_QML_LIB -DQT_STRICT_ITERATORS -DQT_USE_QSTRINGBUILDER -Itemplates/lib -I/kdesrc/src/kf5/grantlee/templates/lib -Itemplates/lib/Grantlee_Templates_autogen/include -I/kdesrc/src/kf5/grantlee/templates/lib/../scriptabletags -isystem /home/kde-svn/qt5/include -isystem /home/kde-svn/qt5/include/QtQml -isystem /home/kde-svn/qt5/include/QtNetwork -isystem /home/kde-svn/qt5/include/QtCore -isystem /home/kde-svn/qt5/./mkspecs/linux-g++ -pipe -O3 -march=native -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-common -pedantic-errors -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -std=gnu++11 -MD -MT templates/lib/CMakeFiles/Grantlee_Templates.dir/lexer.cpp.o -MF templates/lib/CMakeFiles/Grantlee_Templates.dir/lexer.cpp.o.d -o templates/lib/CMakeFiles/Grantlee_Templates.dir/lexer.cpp.o -c /kdesrc/src/kf5/grantlee/templates/lib/lexer.cpp
In file included from /kdesrc/src/kf5/grantlee/templates/lib/lexer.cpp:21:
/kdesrc/src/kf5/grantlee/templates/lib/lexer_p.h:56:16: error: field ‘m_tokenList’ has incomplete type ‘QList<Grantlee::Token>’
QList<Token> m_tokenList;
^~~~~~~~~~~
In file included from /home/kde-svn/qt5/include/QtCore/qglobal.h:1212,
from /home/kde-svn/qt5/include/QtCore/qchar.h:43,
from /home/kde-svn/qt5/include/QtCore/qstring.h:48,
from /home/kde-svn/qt5/include/QtCore/QString:1,
from /kdesrc/src/kf5/grantlee/templates/lib/statemachine_p.h:24,
from /kdesrc/src/kf5/grantlee/templates/lib/textprocessingmachine_p.h:24,
from /kdesrc/src/kf5/grantlee/templates/lib/lexer_p.h:24,
from /kdesrc/src/kf5/grantlee/templates/lib/lexer.cpp:21:
/home/kde-svn/qt5/include/QtCore/qtypeinfo.h:212:1: note: declaration of ‘class QList<Grantlee::Token>’
Q_DECLARE_MOVABLE_CONTAINER(QList);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/kdesrc/src/kf5/grantlee/templates/lib/lexer.cpp:274:43: error: return type ‘class QList<Grantlee::Token>’ is incomplete
QList<Token> Lexer::tokenize(TrimType type)
^
When building Grantlee on Gentoo Linux with GCC 8.2 and Qt -dev branch (5.13 pre), Grantlee fails to build due to an incomplete type error in templates/lib/lexer_p.h. See below.
I'm not precisely sure why this would have worked before because lexer_p.h seems to be using enough of the Lexer class in some of the defined functions to have warranted requiring a complete type definition for QList early. Possibly older Qt headers had included QList already somehow and they managed to clean it up?
Either way I'll have a PR submitted if you want or you can just fix a different way, it's up to you.
--- (gcc -v) ... gcc version 8.2.0 (Gentoo 8.2.0-r5 p1.6)
--- (qmake -v) QMake version 3.1 Using Qt version 5.13.0 in /home/kde-svn/qt5/lib
--- (error log)