Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
Qt Creator 2.4.0
Description
When using F2 or Shift+F2 to go to the declaration of a function which was declared by a multi-line preprocessor macro, Qt Creator will jump to the wrong line. It seems to add the number of lines from the preprocessor macro to the correct line.
Steps to reproduce:
1. Paste the following code in a file in Creator:
#define DECLARE(x) \ int get ## x () const; \ void set ## x (int); struct Foo { DECLARE(X) DECLARE(Y) }; void Foo::setX(int) {}
2. Place the cursor on the cursor on the "setX" on the last line
3. Press F2 or Shift+F2
Expected outcome:
The cursor jumps to line 6, the one with DECLARE(X).
Actual outcome:
The cursor jumps to line 8, two lines below the correct line. Note how two lines below is also the number of lines from the beginning of the macro to the declaration of the symbol we're looking for.
Note also that the cursor ended up on DECLARE(Y), which is very similar and potentially very confusing.
Attachments
Issue Links
- relates to
-
QTCREATORBUG-7516 Follow Symbol on tr leads to wrong location
- Closed