clang plugin should allow raw pointers in lambda init-capture |
||
Issue descriptionAs described in [1] the clang-plugin currently disallows capturing raw pointers in a lambda init capture, as it triggers the "Do not use auto to deduce a raw pointer" check [2]. Since there is no explicit mention of `auto` in the capture list, this is likely a bug and should be fixed. [1] https://groups.google.com/a/chromium.org/d/msg/cxx/8BHoi4T6ZhA/pWHB6IYoAgAJ [2] https://www.chromium.org/developers/coding-style/cpp-dos-and-donts#TOC-Do-not-use-auto-to-deduce-a-raw-pointer
,
Jan 23 2018
,
Jan 25 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5bc544cfb9c6aa72cb53d6491e2e64c4a38d2bbe commit 5bc544cfb9c6aa72cb53d6491e2e64c4a38d2bbe Author: jdoerrie <jdoerrie@chromium.org> Date: Thu Jan 25 18:26:09 2018 [clang-tool] Allow Pointers in Lambda Init Capture This change fixes clang-tool to allow pointers in lambda init-captures. Prior to this change it erroneously triggered the auto raw pointer check. Bug: 804944 Change-Id: Ifc8811d80cefcc593383c21d7c086d3ba719975f Reviewed-on: https://chromium-review.googlesource.com/879181 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org> Cr-Commit-Position: refs/heads/master@{#531954} [modify] https://crrev.com/5bc544cfb9c6aa72cb53d6491e2e64c4a38d2bbe/tools/clang/plugins/FindBadConstructsConsumer.cpp [modify] https://crrev.com/5bc544cfb9c6aa72cb53d6491e2e64c4a38d2bbe/tools/clang/plugins/tests/auto_raw_pointer.cpp [modify] https://crrev.com/5bc544cfb9c6aa72cb53d6491e2e64c4a38d2bbe/tools/clang/pylib/clang/plugin_testing.py
,
Jan 25 2018
r531954 fixes this issue. How frequently is the clang-tool updated? I.e. when could I use a raw pointer in an init-capture without breaking compilation? |
||
►
Sign in to add a comment |
||
Comment 1 by danakj@chromium.org
, Jan 23 2018