Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Issue 2108823004: clang-plugins: Don't strip non const references in auto raw ptr fixits. (Closed)

Created:
4 years, 5 months ago by vmpstr
Modified:
4 years, 5 months ago
Reviewers:
Nico, dcheng
CC:
chromium-reviews, danakj, Nico
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

clang-plugins: Don't strip non const references in auto raw ptr fixits. This patch updates the clang plugin not to strip references to non const pointers, since the fixit might modify behavior: int number; std::vector<int*> vector{&number}; auto& a = vector[0]; a = nullptr; // Modifies the vector. Without this patch, the suggestions is to replace auto& with auto* yielding: int number; std::vector<int*> vector{&number}; auto* a = vector[0]; a = nullptr; // Does not modify the vector anymore. With this patch, the suggestion is the following: int number; std::vector<int*> vector{&number}; auto*& a = vector[0]; a = nullptr; // Modifies the vector. R=dcheng BUG=554600 Committed: https://crrev.com/678f0872c6250ab00efda5f6aba79b923585dc71 Cr-Commit-Position: refs/heads/master@{#403005}

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -11 lines) Patch
M tools/clang/plugins/FindBadConstructsConsumer.cpp View 1 chunk +6 lines, -0 lines 0 comments Download
M tools/clang/plugins/tests/auto_raw_pointer.cpp View 2 chunks +12 lines, -1 line 1 comment Download
M tools/clang/plugins/tests/auto_raw_pointer.txt View 1 chunk +26 lines, -10 lines 0 comments Download

Messages

Total messages: 13 (5 generated)
vmpstr
Please take a look. I talked to danakj about this and we're OK with a ...
4 years, 5 months ago (2016-06-29 20:49:15 UTC) #2
Nico
Makes sense to me.
4 years, 5 months ago (2016-06-29 20:53:58 UTC) #3
dcheng
lgtm
4 years, 5 months ago (2016-06-29 22:27:01 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2108823004/1
4 years, 5 months ago (2016-06-29 22:30:33 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 5 months ago (2016-06-30 00:07:14 UTC) #8
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/678f0872c6250ab00efda5f6aba79b923585dc71 Cr-Commit-Position: refs/heads/master@{#403005}
4 years, 5 months ago (2016-06-30 00:10:16 UTC) #10
Nico
https://codereview.chromium.org/2108823004/diff/1/tools/clang/plugins/tests/auto_raw_pointer.cpp File tools/clang/plugins/tests/auto_raw_pointer.cpp (right): https://codereview.chromium.org/2108823004/diff/1/tools/clang/plugins/tests/auto_raw_pointer.cpp#newcode5 tools/clang/plugins/tests/auto_raw_pointer.cpp:5: #include <utility> This new test fails on the mac ...
4 years, 5 months ago (2016-07-01 20:00:26 UTC) #12
vmpstr
4 years, 5 months ago (2016-07-01 20:32:09 UTC) #13
Message was sent while issue was closed.
On 2016/07/01 20:00:26, Nico wrote:
>
https://codereview.chromium.org/2108823004/diff/1/tools/clang/plugins/tests/a...
> File tools/clang/plugins/tests/auto_raw_pointer.cpp (right):
> 
>
https://codereview.chromium.org/2108823004/diff/1/tools/clang/plugins/tests/a...
> tools/clang/plugins/tests/auto_raw_pointer.cpp:5: #include <utility>
> This new test fails on the mac upload bots:
>
https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_upload_clang...
> (see bottom)
> 
> The plugin tests are supposed to be standalone, please don't include system
> headers here (some other tests stub out just the bits they need, see there for
> reference).
> 
> This is currently blocking clang rolls; please take a look.

Sorry, I didn't realize. I will have a fix ASAP

Powered by Google App Engine
This is Rietveld 408576698