https://bugs.kde.org/show_bug.cgi?id=415029
Bug ID: 415029
Summary: Fails do compile due to Q_FOREACH
Product: plasma-pass
Version: 1.1.0
Platform: Debian stable
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: General
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
While compiling from scratch, I get this error:
[ 45%] Building CXX object
plugin/CMakeFiles/plasmapass.dir/passwordprovider.cpp.o
In file included from /usr/include/KF5/KService/kplugininfo.h:28,
from /usr/include/KF5/plasma/package.h:25,
from /usr/include/KF5/plasma/pluginloader.h:23,
from /usr/include/KF5/Plasma/PluginLoader:1,
from
/tmp/tmp.3V2PlGdnUp/Descargas/plasma-pass-1.1.0/plugin/passwordprovider.cpp:33:
/usr/include/KF5/KConfigCore/kconfiggroup.h: In member function ‘QList<T>
KConfigGroup::readEntry(const char*, const QList<T>&) const’:
/usr/include/KF5/KConfigCore/kconfiggroup.h:734:16: error: expected
primary-expression before ‘const’
Q_FOREACH (const T &value, defaultValue) {
^~~~~
/usr/include/KF5/KConfigCore/kconfiggroup.h:734:45: error: expected ‘;’ before
‘{’ token
Q_FOREACH (const T &value, defaultValue) {
^~
;
/usr/include/KF5/KConfigCore/kconfiggroup.h:739:16: error: expected
primary-expression before ‘const’
Q_FOREACH (const QVariant &value, readEntry<QVariantList>(key, data)) {
^~~~~
/usr/include/KF5/KConfigCore/kconfiggroup.h:739:5: error: there are no
arguments to ‘Q_FOREACH’ that depend on a template parameter, so a declaration
of ‘Q_FOREACH’ must be available [-fpermissive]
Q_FOREACH (const QVariant &value, readEntry<QVariantList>(key, data)) {
^~~~~~~~~
/usr/include/KF5/KConfigCore/kconfiggroup.h:739:5: note: (if you use
‘-fpermissive’, G++ will accept your code, but allowing the use of an
undeclared name is deprecated)
/usr/include/KF5/KConfigCore/kconfiggroup.h:739:74: error: expected ‘;’ before
‘{’ token
Q_FOREACH (const QVariant &value, readEntry<QVariantList>(key, data)) {
^~
;
/usr/include/KF5/KConfigCore/kconfiggroup.h: In member function ‘void
KConfigGroup::writeEntry(const char*, const QList<T>&,
KConfigBase::WriteConfigFlags)’:
/usr/include/KF5/KConfigCore/kconfiggroup.h:760:16: error: expected
primary-expression before ‘const’
Q_FOREACH (const T &value, list) {
^~~~~
/usr/include/KF5/KConfigCore/kconfiggroup.h:760:37: error: expected ‘;’ before
‘{’ token
Q_FOREACH (const T &value, list) {
^~
;
make[2]: *** [plugin/CMakeFiles/plasmapass.dir/build.make:126:
plugin/CMakeFiles/plasmapass.dir/passwordprovider.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:596: plugin/CMakeFiles/plasmapass.dir/all]
Error 2
make: *** [Makefile:141: all] Error 2
STEPS TO REPRODUCE
1. Download and extract 1.1.0 tar
2. Run cmake
3. Run make
OBSERVED RESULT
A compiler error
EXPECTED RESULT
A compiled binary
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian GNU/Linux "Buster" 10.2
(available in About System)
KDE Plasma Version: 5.14.5.1
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.3
ADDITIONAL INFORMATION
Investigating the issue, I found the following commit:
https://cgit.kde.org/plasma-pass.git/commit/?id=d5999a0b6a7c3d1d126cd6afb25f38e573aa7d57
There, it claims Q_FOREACH is not needed, and sets a flag to disable it.
Looks like the project itself doesn't use Q_FOREACH, but an indirect import
does.
I removed the line:
add_definitions(-DQT_NO_FOREACH)
from the "CMakeLists.txt" file and everything compiled fine.
--
You are receiving this mail because:
You are watching all bug changes.