aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-07-29 09:17:13 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-07-30 10:08:21 +0200
commit6428bb8f857ca83c244f1d021f9fae0ec3ee6b46 (patch)
tree622816d576fe4042b7b281750f8145a2c5a675d1 /sources/shiboken2/ApiExtractor
parent9318c09dbaa0ac78beb8edfd76a650e46e1a1b09 (diff)
parentf563bf430aeadc7b15433b28bf848fa0c68ba394 (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"
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 5dc761d49..9c930dcdc 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);