[Qt-creator] Turn off "suggest-override" clang-tidy warning?
Andy
asmaloney at gmail.com
Tue May 11 02:36:11 CEST 2021
Thanks Eike.
The project is based on Qt 5.15.2. ClangCodeModel is on.
I have it set in the Analyzer prefs to "Analyze open files". Both
clang-tidy & clazy point to the executables in QtCreator.app.
When I run "clang-tidy & clazy" manually through the Debug tab, it shows:
warning: 'metaObject' overrides a member function but is not marked
'override' [suggest-override]
warning: 'qt_metacall' overrides a member function but is not marked
'override' [suggest-override]
warning: 'qt_metacast' overrides a member function but is not marked
'override' [suggest-override]
And the tooltip on them has the link from my first email.
But it doesn't show the warning inline in the editor on the Q_OBJECT line.
(I'm fairly sure it was showing those when I reported it? I don't know -
I'm sleep deprived.)
Adding "-Wno-suggest-override" to analyzer's Clang Warnings DOES fix it, so
thank you! Still don't understand where it's coming from though.
I'm also confused why we have Clang Warning "Diagnostic Configurations"
under both the "C++ -> Code Model" and "Analyzer".
---
Andy Maloney // https://asmaloney.com
twitter ~ @asmaloney <https://twitter.com/asmaloney>
On Mon, May 10, 2021 at 2:58 AM Eike Ziller <Eike.Ziller at qt.io> wrote:
>
>
> > On May 7, 2021, at 23:26, Andy <asmaloney at gmail.com> wrote:
> >
> > How do I turn off the "suggest-override" tidy warning? The tooltip for
> it points at a non-existent clang-tidy page:
> >
> >
> https://releases.llvm.org/11.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/suggest-override.html
> >
> > It is triggered by every use of Q_OBJECT.
>
> Do you have a bit more information?
> Are you using an old Qt version? I remember Q_OBJECT triggering override
> related compilation warnings once upon a time.
> Does it go away if you remove all clang-tidy and clazy checks?
> I wonder if this isn’t actually a compiler warning from clang (the clang
> code model, -Wsuggest-override). Does adding -Wno-suggest-override to the
> _clang warnings_ help?
> Though I wonder how Qt Creator comes up with that URL above.
>
> Br, Eike
>
> >
> > The only clang-tidy option I can find relating to overrides is called
> "modernize-use-override" which I have turned off.
> >
> >
> https://releases.llvm.org/11.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize-use-override.html
> >
> > Using the clang-tidy included with Qt Creator 4.15
> > macOS 10.14.6
> >
> > ---
> > Andy Maloney // https://asmaloney.com
> > twitter ~ @asmaloney
> >
> > _______________________________________________
> > Qt-creator mailing list
> > Qt-creator at qt-project.org
> > https://lists.qt-project.org/listinfo/qt-creator
>
> --
> Eike Ziller
> Principal Software Engineer
>
> The Qt Company GmbH
> Erich-Thilo-Straße 10
> D-12489 Berlin
> eike.ziller at qt.io
> http://qt.io
> Geschäftsführer: Mika Pälsi,
> Juha Varelius, Jouni Lintunen
> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht
> Charlottenburg, HRB 144331 B
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20210510/1b28b880/attachment.html>
More information about the Qt-creator
mailing list