aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-02-21 09:02:15 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-02-23 08:40:33 +0000
commit34fec1cad23e2c6fe8ecf907419b231817e27564 (patch)
treea0f70a6d70d4fdc11659d2620212ec25cf27840f /src/tools
parent38d15ebe2f6b398a7c3a3ca7a32335b5f4ed708d (diff)
Clang: Make Q_PROPERTY replacement simpler
The infrastructure around Q_PROPERTY extraction allows to make it static assert and still find it's parent. This way makes it easier for Clang to parse and does not provide unexisting functions for class. Change-Id: I1c40550c72d214c2448169094a46c6f793132f23 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clangbackend/source/fulltokeninfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/clangbackend/source/fulltokeninfo.cpp b/src/tools/clangbackend/source/fulltokeninfo.cpp
index f5e9fa7851..a8e4a41fc8 100644
--- a/src/tools/clangbackend/source/fulltokeninfo.cpp
+++ b/src/tools/clangbackend/source/fulltokeninfo.cpp
@@ -86,7 +86,7 @@ static Utf8String propertyParentSpelling(CXTranslationUnit cxTranslationUnit,
tuCursor.visit([&filePath, line, column, &parentSpelling](CXCursor cxCursor, CXCursor parent) {
const CXCursorKind kind = clang_getCursorKind(cxCursor);
if (kind == CXCursor_Namespace || kind == CXCursor_StructDecl
- || kind == CXCursor_ClassDecl || kind == CXCursor_CXXMethod) {
+ || kind == CXCursor_ClassDecl || kind == CXCursor_StaticAssert) {
Cursor cursor(cxCursor);
const SourceRange range = cursor.sourceRange();
if (range.start().filePath() != filePath)
@@ -96,7 +96,7 @@ static Utf8String propertyParentSpelling(CXTranslationUnit cxTranslationUnit,
|| kind == CXCursor_ClassDecl) {
return CXChildVisit_Recurse;
}
- // CXCursor_CXXMethod case. This is Q_PROPERTY_MAGIC_FUNCTION
+ // CXCursor_StaticAssert case. This is Q_PROPERTY static_assert
parentSpelling = Cursor(parent).type().spelling();
return CXChildVisit_Break;
}