diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-08 16:17:52 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-08 16:43:49 +0200 |
commit | b6c627e87f844e9ae68bcc579d3cb0ea784ac77c (patch) | |
tree | 761089170abe6c2d3a8d9e2482bd4ea4cce3a177 /sources | |
parent | 1b77fc5931bf14b2a9e936a8d08334d9e00ffe7e (diff) |
shiboken: List location of anonymous structs in rejected classes
Anonymous structs showed up as mysterious, empty entries in
mjb_rejected_classes.log. Output the location.
Change-Id: I0754e426a9fff3d1dac03aa587747ab0d7816df5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 4 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/parser/codemodel.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index bb9b94a5b..4b31dbb05 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1052,6 +1052,10 @@ AbstractMetaClass *AbstractMetaBuilderPrivate::traverseClass(const FileModelItem reason = AbstractMetaBuilder::GenerationDisabled; } if (reason != AbstractMetaBuilder::NoReason) { + if (fullClassName.isEmpty()) { + QTextStream(&fullClassName) << "anonymous struct at " << classItem->fileName() + << ':' << classItem->startLine(); + } m_rejectedClasses.insert(fullClassName, reason); return nullptr; } diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.h b/sources/shiboken2/ApiExtractor/parser/codemodel.h index 777b2d103..80db2cce5 100644 --- a/sources/shiboken2/ApiExtractor/parser/codemodel.h +++ b/sources/shiboken2/ApiExtractor/parser/codemodel.h @@ -287,6 +287,7 @@ public: FileModelItem file() const; void getStartPosition(int *line, int *column); + int startLine() const { return m_startLine; } void setStartPosition(int line, int column); void getEndPosition(int *line, int *column); |