Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.15.2
-
None
-
Qt 5.15.2, VS2019 16.9.6, Win10.
Description
Compile the attached project to get the error reported by moc: Parse error at "...(file name with path)..."
The project can be compiled successfully with 5.12.5. Not tested with other versions.
Basically, this is the pattern to trigger the bug:
#pragma once
namespace myNameSpace{
typedef enum _MY_ENUMS_ {
#include "MyNames.h"
}eMY_ENUMS;
class QMyClass : public QObject
{
Q_OBJECT
// other contents
};
} // namespace
And this is the contents of MyNames.h:
myEnum1,
myEnum2,
Notice the comma after myEnum2. The moc will be a success if the comma is removed. The tricky part is, if the contents is placed directly inside enum, without using #include, it will also be a success even with the comma after myEnum2.
Attachments
Issue Links
- duplicates
-
QTBUG-88125 [REG: 5.12->5.15]Error processing an enumeration type containing the include directive
- Closed