Ticket #20435: qttools-6.7.2-clang-19.patch

File qttools-6.7.2-clang-19.patch, 4.7 KB (added by Joe Locash, 7 months ago)
  • TabularUnified src/linguist/lupdate/clangtoolastreader.cpp

    diff -Nuarp qttools-everywhere-src-6.7.2.orig/src/linguist/lupdate/clangtoolastreader.cpp qttools-everywhere-src-6.7.2/src/linguist/lupdate/clangtoolastreader.cpp
    old new bool LupdateVisitor::VisitNamedDecl(clan  
    779779    if (!m_macro)
    780780        return true;
    781781    auto fullLocation = m_context->getFullLoc(namedDeclaration->getBeginLoc());
    782     if (!fullLocation.isValid() || !fullLocation.getFileEntry())
     782    if (!fullLocation.isValid() || !fullLocation.getFileEntryRef())
    783783        return true;
    784784
    785     if (!LupdatePrivate::isFileSignificant(fullLocation.getFileEntry()->getName().str()))
     785    if (!LupdatePrivate::isFileSignificant(fullLocation.getFileEntryRef()->getName().str()))
    786786        return true;
    787787
    788788    qCDebug(lcClang) << "NamedDecl Name:   " << QString::fromStdString(namedDeclaration->getQualifiedNameAsString());
  • TabularUnified src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h

    diff -Nuarp qttools-everywhere-src-6.7.2.orig/src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h qttools-everywhere-src-6.7.2/src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h
    old new static inline bool getFullyQualifiedTemp  
    8484  assert(ArgTDecl != nullptr);
    8585  QualifiedTemplateName *QTName = TName.getAsQualifiedTemplateName();
    8686
    87   if (QTName && !QTName->hasTemplateKeyword()) {
    88     NNS = QTName->getQualifier();
     87  if (QTName &&
     88      !QTName->hasTemplateKeyword() &&
     89      (NNS = QTName->getQualifier())) {
    8990    NestedNameSpecifier *QNNS = getFullyQualifiedNestedNameSpecifier(
    9091        Ctx, NNS, WithGlobalNsPrefix);
    9192    if (QNNS != NNS) {
    static inline NestedNameSpecifier *creat  
    288289  assert(Decl);
    289290
    290291  const DeclContext *DC = Decl->getDeclContext()->getRedeclContext();
    291   const auto *Outer = dyn_cast_or_null<NamedDecl>(DC);
    292   const auto *OuterNS = dyn_cast_or_null<NamespaceDecl>(DC);
     292  const auto *Outer = dyn_cast<NamedDecl>(DC);
     293  const auto *OuterNS = dyn_cast<NamespaceDecl>(DC);
    293294  if (Outer && !(OuterNS && OuterNS->isAnonymousNamespace())) {
    294295    if (OuterNS) {
    295296      return createNestedNameSpecifier(Ctx, OuterNS, WithGlobalNsPrefix);
  • TabularUnified src/qdoc/qdoc/src/qdoc/clangcodeparser.cpp

    diff -Nuarp qttools-everywhere-src-6.7.2.orig/src/qdoc/qdoc/src/qdoc/clangcodeparser.cpp qttools-everywhere-src-6.7.2/src/qdoc/qdoc/src/qdoc/clangcodeparser.cpp
    old new static std::string get_expression_as_str  
    167167 * If the parameter has no default value the empty string will be returned.
    168168 */
    169169static std::string get_default_value_initializer_as_string(const clang::TemplateTypeParmDecl* parameter) {
     170#if LIBCLANG_VERSION_MAJOR >= 19
     171    return (parameter && parameter->hasDefaultArgument()) ?
     172                get_fully_qualified_type_name(parameter->getDefaultArgument().getArgument().getAsType(), parameter->getASTContext()) :
     173                "";
     174#else
    170175    return (parameter && parameter->hasDefaultArgument()) ?
    171176                get_fully_qualified_type_name(parameter->getDefaultArgument(), parameter->getASTContext()) :
    172177                "";
     178#endif
    173179
    174180}
    175181
    static std::string get_default_value_ini  
    183189 * If the parameter as no default value the empty string will be returned.
    184190 */
    185191static std::string get_default_value_initializer_as_string(const clang::NonTypeTemplateParmDecl* parameter) {
     192#if LIBCLANG_VERSION_MAJOR >= 19
     193    return (parameter && parameter->hasDefaultArgument()) ?
     194        get_expression_as_string(parameter->getDefaultArgument().getSourceExpression(), parameter->getASTContext()) : "";
     195#else
    186196    return (parameter && parameter->hasDefaultArgument()) ?
    187197        get_expression_as_string(parameter->getDefaultArgument(), parameter->getASTContext()) : "";
     198#endif
    188199
    189200}
    190201
    static std::string get_default_value_ini  
    204215        const clang::TemplateName template_name = parameter->getDefaultArgument().getArgument().getAsTemplate();
    205216
    206217        llvm::raw_string_ostream ss{default_value};
    207         template_name.print(ss, parameter->getASTContext().getPrintingPolicy(), clang::TemplateName::Qualified::Fully);
     218        template_name.print(ss, parameter->getASTContext().getPrintingPolicy(), clang::TemplateName::Qualified::AsWritten);
    208219    }
    209220
    210221    return default_value;