https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292376

--- Comment #7 from Alex S <[email protected]> ---
(In reply to Alex S from comment #6)

I can't confirm this being relevant to qBittorrent, though. Doesn't crash for
me.

The repro looks like this:

~/qt-casting $ cat CMakeLists.txt 
cmake_minimum_required(VERSION 3.16)

project(qt-casting)

set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt6 REQUIRED COMPONENTS Core Widgets)

add_executable(qt-casting main.cpp)
target_link_libraries(qt-casting PRIVATE Qt::Core Qt::Widgets)
~/qt-casting $ cat main.cpp 
#include <cstdio>
#include <QApplication>

class Whatever : public QObject {
    Q_OBJECT
};

#include "main.moc"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    printf("qobject_cast:      %s\n", qobject_cast<QApplication
*>(QCoreApplication::instance()) != nullptr   ? "ok" : "fail");
    printf("inheritance check: %s\n",
QCoreApplication::staticMetaObject.inherits(&QObject::staticMetaObject) ? "ok"
: "fail");

    Whatever whatever;
    printf("%p\n", &whatever);

    return 0;
}
~/qt-casting $ mkdir build
~/qt-casting $ cd build/
~/qt-casting/build $ cmake .. -DCMAKE_BUILD_TYPE:STRING="Release"
...
~/qt-casting/build $ make
...
~/qt-casting/build $ ./qt-casting
qobject_cast:      ok
inheritance check: fail
0x8211dc538

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to