diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-02-14 11:02:14 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-02-15 11:38:52 +0100 |
| commit | 9533a6861b05529f9a9d040dba4d6e33e7883f3f (patch) | |
| tree | 98b616fdfd30031c80b1fbabb4132dc7284d5962 | |
| parent | 27bcf6ad7afb7b5415c6c8dc79331f73e068923b (diff) | |
shiboken6: Add the language level to the keywords of the type system parser
Change-Id: Iff97fbd8199f97c9c1996d551e2c982b4dac13be
Reviewed-by: Christian Tismer <tismer@stackless.com>
| -rw-r--r-- | sources/shiboken6/ApiExtractor/typedatabase.cpp | 18 | ||||
| -rw-r--r-- | sources/shiboken6/doc/typesystem_specifying_types.rst | 7 |
2 files changed, 24 insertions, 1 deletions
diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp index 00a99ff57..cf9eb2404 100644 --- a/sources/shiboken6/ApiExtractor/typedatabase.cpp +++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp @@ -33,6 +33,7 @@ #include "typesystemparser.h" #include "conditionalstreamreader.h" #include "predefined_templates.h" +#include "clangparser/compilersupport.h" #include <QtCore/QBuffer> #include <QtCore/QFile> @@ -246,6 +247,23 @@ QStringList TypeDatabase::typesystemKeywords() const QStringList result = m_typesystemKeywords; for (const auto &d : m_dropTypeEntries) result.append(QStringLiteral("no_") + d); + + switch (clang::emulatedCompilerLanguageLevel()) { + case LanguageLevel::Cpp11: + result.append(u"c++11"_qs); + break; + case LanguageLevel::Cpp14: + result.append(u"c++14"_qs); + break; + case LanguageLevel::Cpp17: + result.append(u"c++17"_qs); + break; + case LanguageLevel::Cpp20: + result.append(u"c++20"_qs); + break; + default: + break; + } return result; } diff --git a/sources/shiboken6/doc/typesystem_specifying_types.rst b/sources/shiboken6/doc/typesystem_specifying_types.rst index 7ee39583e..c1d25cc15 100644 --- a/sources/shiboken6/doc/typesystem_specifying_types.rst +++ b/sources/shiboken6/doc/typesystem_specifying_types.rst @@ -648,7 +648,12 @@ Conditional Processing <?endif?> There are predefined keywords indicating the operating system (``windows``, - ``unix`` and ``darwin``). The class names passed to the + ``unix`` and ``darwin``). + + The language level passed to the ``language-level`` command line option + is reflected as ``c++11``, ``c++14``, ``c++17`` or ``c++20``. + + The class names passed to the :ref:`--drop-type-entries <drop-type-entries>` command line option are also predefined, prefixed by ``no_``. This allows for example for enclosing added functions referring to those classes within |
