PDA

View Full Version : Using shift operator in enums not working



iwatsu
1st December 2015, 23:38
this kind of code worked fine in Qt 5.4 but doesn't compile in 5.5. Is that a bug or is there a reason that this isn't supposed to work?
I get an error: qt_getEnumMetaObject: none of the 5 overloads could convert all the argument types



#include <QCoreApplication>
#include <QDebug>

enum {
test1 = 0
};

enum {
sun = (1 << test1)
};

enum {
bla = (1 << sun)
};
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "test";
return a.exec();
}

anda_skoa
4th December 2015, 16:23
That doesn't look Qt related at all.

Do you still get the problem if you have an empty main()?

Cheers,
_

d_stranz
5th December 2015, 23:15
The error looks Qt-related, but it almost certainly has nothing to do with the code that was posted.