Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

Clazy 1.4 released

presenting 10 new Qt compile-time checks

class MyFrame : public QFrame
{
    Q_OBJECT
public:
    bool event(QEvent *ev) override
    {
        (...)
        // warning: Maybe you meant to call QFrame::event() instead [-Wclazy-skipped-base-method]
        return QWidget::event(ev);
    }
};
switch (ev->type()) {
    case QEvent::MouseMove:
        auto e = static_cast<QKeyEvent*>(ev);
}
namespace MyNameSpace {
    struct MyType { (...) };
    class MyObject : public QObject
    {
        Q_OBJECT
        Q_PROPERTY(MyGadget myprop READ myprop); // Wrong, needs namespace
    Q_SIGNALS:
        void mySignal(MyType); // Wrong
        void mySignal(MyNameSpace::MyType); // OK
    };
}
static auto pmf = &QObject::destroyed;
if (pmf == &QObject::destroyed) // Should be false for MingW

9 Comments

12 - Oct - 2018

Bugfinger

14 - Oct - 2018

Vadim Peretokin

14 - Oct - 2018

Elvis Angelaccio

14 - Oct - 2018

Sérgio Martins

14 - Oct - 2018

Sérgio Martins

18 - Oct - 2018

Mark de Wit

clazy-1.4/src/SourceCompatibilityHelpers.h:52:12: error: no viable conversion from returned value
      of type 'std::pair' to function return type 'clang::CharSourceRange'
    return sm.getImmediateExpansionRange(macroLoc);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

18 - Oct - 2018

Sérgio Martins

25 - Oct - 2018

Henry Miller

/opt/jdx/tools//usr/local/bin/clazy    --sysroot=/home/hm68841/workspace/guidance/jdx/wr8-baytrail_64/buildbox -std=c++14 -fno-omit-frame-pointer -gsplit-dwarf -fdiagnostics-color=always --target=x86_64-wrs-linux -o CMakeFiles/cmTC_c0901.dir/testCXXCompiler.cxx.o -c testCXXCompiler.cxx
    : CommandLine Error: Option 'static-func-full-module-prefix' registered more than once!
    fatal error: error in backend: inconsistency in registered CommandLine options```

25 - Oct - 2018

Sérgio Martins

SérgioMartins

Sérgio Martins

Senior Software Engineer

Learn Modern C++

Learn more