Commit Graph

16 Commits

Author SHA1 Message Date
Alessandro Portale
adea8467f4 Fix warning: "Don't call QHash::operator[]() on temporary"
[-Wclazy-detaching-temporary]

Change-Id: Ide503c9260af285fa1dbedb63f7819c8ad616db6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-17 10:04:11 +00:00
Ivan Donchevskii
840ab99115 Clang: Add default diagnostic configuration for Clazy
... and Clang-Tidy + Clazy.

Use stable 'level0' checks.

Change-Id: Icdcbb8807f7925bf93f8b4e11a00c2710d6693cd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-06-20 07:00:23 +00:00
Ivan Donchevskii
6575cfc674 Clang: Add default configurations with Clang-Tidy checks
The first configuration contains most of checks
which make sense for most of generic projects.

The second configuration is extremely slow but plays
the role of Clang static analyzer.

For the sake of viewing these checks Clang-Tidy checks tree
is modified to be expandable in read-only mode.

Change-Id: I41c4ee26bcdf05384507427b842d61e255d59bf7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-06-20 07:00:16 +00:00
Nikolai Kosjar
a741b7300f Clang: Avoid diagnostics about unknown qdoc commands
Task-number: QTCREATORBUG-20512
Change-Id: Icbdcf7871738c9900544516467154ef73c595e1b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-29 10:28:16 +00:00
Nikolai Kosjar
a809462c91 ClangTools: Avoid warnings from Q_OBJECT, too
Change-Id: I4540c1e2d9123af12e9f96976d6e37fe25aaf728
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-23 10:48:06 +00:00
Nikolai Kosjar
e287a7c6dd CppTools: Remove unused function
Change-Id: Ida0def5702bf17551f6e51e2715cee36c768683e
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-16 07:16:43 +00:00
Nikolai Kosjar
8441bb0933 Clang: Avoid warnings about unknown warning options
...as they are generated by e.g. Q_OBJECT use.

Previously we have avoided Q_OBJECT warnings by using
-Wno-unknown-pragmas (Qt Creator build with libclang 3.9). With the
upgrade to libclang 5.0 GCC pragmas can now be parsed by clang and the
related warning option thus changed to -Wunknown-warning-option.

Note that previously -Wno-unknown-pragmas was part of every built-in
configuration and visible in the UI. Now that option and the new one are
added behind the scenes (not visible in the UI anymore) so that every
diagnostic configuration, also the copied/customized ones, will profit
from it. Still, by putting this hidden options first on the command
line, the user can overwrite them with his own configuration if desired.

Task-number: QTCREATORBUG-17460
Change-Id: I68aaec1b4791522bd8dc4e5fdb405cc5b9c9f514
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-11 07:15:35 +00:00
Nikolai Kosjar
33b6fe812a Clang: Make clazy/tidy options part of the diagnostic config
As a side effect, clazy/tidy options become available for project
specific customization in the projects mode.

Change-Id: Id72762dedd857915139c15f532d2f1c6d1f43edb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-29 08:14:14 +00:00
Nikolai Kosjar
9b4688f1a4 Clang: Let CppCodeModelSettings announce invalidated diagnostic configs
Change-Id: I1fe62d4cd4bc91bfd73e57ace6dc9a87d13b3537
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-29 08:13:44 +00:00
Nikolai Kosjar
43a3ea1d22 CppTools: Remove pointless loop
Change-Id: Ie6c597421f81529973351a6363c0110435e42c29
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-19 14:54:08 +00:00
David Schulz
e97ff9f739 Clang: Do not warn about unhandled enum values
... in switch as long as there is a default case.

Change-Id: I584660cb26ee03a9ce3e41b297af0093dce59d1f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-07-24 14:21:36 +00:00
Ivan Donchevskii
78db7d7ed2 Clang: turn off delayed template parsing
Fix templates highlight and completion on Windows
Add UI to turn on/off delayed parsing (off by default)

Task-number: QTCREATORBUG-17222
Change-Id: I0cd5e0bcfff2789cd938e4096829f777ff15957a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-08 10:53:31 +00:00
Nikolai Kosjar
e788333510 Clang: Add -Wno-used-but-marked-unused
...to built-in diagnostic configuration "Warnings for almost
everything".

Change-Id: I2a70c76c5b876cc0dc8cebd80c2457550b608593
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-12 10:13:55 +00:00
Nikolai Kosjar
7d39f94f3d Clang: Avoid warnings about unknown pragmas
Task-number: QTCREATORBUG-17460
Change-Id: Ic57f59f87b58c44ac738fb87039b4844d82bc924
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-24 10:51:43 +00:00
Nikolai Kosjar
83e18c127c Clang: Introduce warning configuration per project
Change-Id: I5b9a330274e6f72b0786259eb25aa454877d4eef
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-03-01 15:55:30 +00:00
Nikolai Kosjar
8cfef9657a Clang: Introduce switching/adding of warning configurations
A warning configuration is a list of command line (warning) options for
libclang. Three non-editable built-in configurations are provided by
default. The user can copy a configuration to customize it.

This is still a global setting and it changes take effect after
re-opening a document. Both issues will be addressed in follow-up
changes.

Change-Id: I86667d7dc39ad31b88666454220e6da563797740
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-03-01 11:21:36 +00:00