-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 2.2.0, Qt Creator 2.4.0-beta
-
None
-
Windows XP SP3
-
1c3c50945dbd4d3473ba431c9e8c31e807078f3a
Refactoring doesn't work correctly if the variable is used in sizeof().
If you trigger refactoring outside of sizeof(), only the occurences
outside sizeof are changed (wrong_behaviour.png).
If you trigger inside the sizeof(), all occurences are marked (better_behaviour.png), but the global search & replace dialog appears (global_replace.png).
test.cpp
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); char buf[256]; strncpy(buf, "test", sizeof(buf)); buf[sizeof(buf)] = 0; } MainWindow::~MainWindow() { delete ui; }