diff --git a/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h b/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h index 001eea3cb43..aad3de8f27d 100644 --- a/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h +++ b/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h @@ -60,14 +60,8 @@ # define Q_SLOT __attribute__((annotate("qt_slot"))) #endif -template -using QPropertyMagicString = std::integer_sequence; - -template -constexpr QPropertyMagicString operator""_qpropstr() { return { }; } - -// Create unique AST node for the property. -#define Q_PROPERTY(arg) void QPropertyMagicFunction(decltype(#arg ## _qpropstr)); +// static_assert can be found as a class child but does not add extra AST nodes for copmpletion +#define Q_PROPERTY(arg) static_assert("Q_PROPERTY", #arg); #pragma clang diagnostic pop diff --git a/src/tools/clangbackend/source/fulltokeninfo.cpp b/src/tools/clangbackend/source/fulltokeninfo.cpp index f5e9fa78512..a8e4a41fc8e 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; }