aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp4
-rw-r--r--sources/shiboken2/ApiExtractor/messages.cpp17
-rw-r--r--sources/shiboken2/ApiExtractor/messages.h2
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel.h1
4 files changed, 24 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/messages.cpp b/sources/shiboken2/ApiExtractor/messages.cpp
index a6e75aac3..5b3a57fcc 100644
--- a/sources/shiboken2/ApiExtractor/messages.cpp
+++ b/sources/shiboken2/ApiExtractor/messages.cpp
@@ -311,6 +311,23 @@ QString msgCannotUseEnumAsInt(const QString &name)
"Compilation errors may occur when used as a function argument.");
}
+QString msgConversionTypesDiffer(const QString &varType, const QString &conversionType)
+{
+ QString result;
+ QTextStream str(&result);
+ str << "Types of receiver variable ('" << varType
+ << "') and %%CONVERTTOCPP type system variable ('" << conversionType
+ << "') differ";
+ QString strippedVarType = varType;
+ QString strippedConversionType = conversionType;
+ TypeInfo::stripQualifiers(&strippedVarType);
+ TypeInfo::stripQualifiers(&strippedConversionType);
+ if (strippedVarType == strippedConversionType)
+ str << " in qualifiers. Please make sure the type is a distinct token";
+ str << '.';
+ return result;
+}
+
// main.cpp
QString msgLeftOverArguments(const QMap<QString, QString> &remainingArgs)
diff --git a/sources/shiboken2/ApiExtractor/messages.h b/sources/shiboken2/ApiExtractor/messages.h
index ab2bf64b6..2fee0de8f 100644
--- a/sources/shiboken2/ApiExtractor/messages.h
+++ b/sources/shiboken2/ApiExtractor/messages.h
@@ -115,6 +115,8 @@ QString msgCannotOpenForWriting(const QFile &f);
QString msgCannotUseEnumAsInt(const QString &name);
+QString msgConversionTypesDiffer(const QString &varType, const QString &conversionType);
+
QString msgLeftOverArguments(const QMap<QString, QString> &remainingArgs);
QString msgInvalidVersion(const QString &package, const QString &version);
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);