Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 7.0.1
-
None
-
Windows 10 Home 21H1 19043.1645
Qt Creator 7.01
MS Visual C++ compiler version 15
Description
I see this with "2712:5: Using the result of an assignment as a condition without parentheses (fixes available)" but the behavior I'm reporting probably happens with other warnings.
This warning is triggered by code like this:
if(flg=pP->getFlag(scaleFlags)){
The warning puts a little yellow triangle in the left margin, and a light bulb at the end of the line that invokes fixits:
Prior to 7.01 clicking on the lightbulb presented a popup with two fixit choices: either replace "=" with "==" or to enclose the assignment in parens to show that the assignment is intentional. In 7.01 if I click the lightbulb, it simply applies the conversion to "==". I did this recently and didn't notice the problem, creating a bug that was very hard to see!
Further, hoviering over the yellow triangle puts up a tooltip-like window with info about the warning:
The blue text is a link, clicking the link applies BOTH fixits:
if((flg==pP->getFlag(scaleFlags))){
Now I have two clangd warnings!
Our application is very old and has a ton of these. I use the fixit to enclose in parens every day!
Attachments
For Gerrit Dashboard: QTCREATORBUG-27514 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
410765,2 | ClangCodeModel: Fix handling of code actions in diagnostic tooltip | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
411204,3 | LanguageClient: run quick fix assist on lightbulb click | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |