FindBadConstructsConsumer treats some POD members as non-POD |
||
Issue descriptionSee discussion in https://codereview.chromium.org/2484803003: this Clang plugin thinks that for a class/struct to have-a std::atomic_int means that the class is non-trivial, presumably because atomic_int has some template magic. In fact, not all templated things are non-trivial. dcheng: I'll try my hand at it.
,
Nov 8 2016
I'm handwaving a bit here, but if it's possible to defer checking templates until they're actually instantiated (as a CXXTemplateSpecializationDecl, I think?), I think that will help us achieve the right behavior: I'm hoping we would be able to use things like hasTrivialDestructor() to determine whether or not a templated type can be treated as trivial.
,
Nov 8 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9d17488d4ed2bfecab3d6e723881e1d9cedfb90a commit 9d17488d4ed2bfecab3d6e723881e1d9cedfb90a Author: palmer <palmer@chromium.org> Date: Tue Nov 08 23:54:58 2016 Treat atomic_int as a trivial class member when checking for non-trivial classes. This is a quick hack to unblock work on https://codereview.chromium.org/2484803003. The real fix will be to check the class after template instantiation. BUG=663463 Review-Url: https://codereview.chromium.org/2483973003 Cr-Commit-Position: refs/heads/master@{#430773} [modify] https://crrev.com/9d17488d4ed2bfecab3d6e723881e1d9cedfb90a/tools/clang/plugins/FindBadConstructsConsumer.cpp [add] https://crrev.com/9d17488d4ed2bfecab3d6e723881e1d9cedfb90a/tools/clang/plugins/tests/trivial_ctor.cpp [add] https://crrev.com/9d17488d4ed2bfecab3d6e723881e1d9cedfb90a/tools/clang/plugins/tests/trivial_ctor.h [modify] https://crrev.com/9d17488d4ed2bfecab3d6e723881e1d9cedfb90a/tools/clang/plugins/tests/virtual_bodies.h
,
Nov 9 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/11cb6892af5990d0e4430a8624d5643a1d658d46 commit 11cb6892af5990d0e4430a8624d5643a1d658d46 Author: thakis <thakis@chromium.org> Date: Wed Nov 09 15:05:29 2016 Revert of Treat std::atomic_int as a trivial class member when checking for non-trivial classes. (patchset #2 id:20001 of https://codereview.chromium.org/2483973003/ ) Reason for revert: This broke all clang tot bots, e.g. here: https://build.chromium.org/p/chromium.fyi/builders/ClangToTLinux%20%28dbg%29/builds/4709/steps/gclient%20runhooks/logs/stdio Testing trivial_ctor.cpp... failed: no expected file found ... Ran 18 tests: 17 succeeded, 1 failed trivial_ctor Original issue's description: > Treat atomic_int as a trivial class member when checking for non-trivial classes. > > This is a quick hack to unblock work on > https://codereview.chromium.org/2484803003. The real fix will be to check the > class after template instantiation. > > BUG=663463 > > Committed: https://crrev.com/9d17488d4ed2bfecab3d6e723881e1d9cedfb90a > Cr-Commit-Position: refs/heads/master@{#430773} TBR=dcheng@chromium.org,erg@chromium.org,palmer@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=663463 Review-Url: https://codereview.chromium.org/2491523002 Cr-Commit-Position: refs/heads/master@{#430930} [modify] https://crrev.com/11cb6892af5990d0e4430a8624d5643a1d658d46/tools/clang/plugins/FindBadConstructsConsumer.cpp [delete] https://crrev.com/4e2a6810fd84198ce9d8062d69393076b48a91e9/tools/clang/plugins/tests/trivial_ctor.cpp [delete] https://crrev.com/4e2a6810fd84198ce9d8062d69393076b48a91e9/tools/clang/plugins/tests/trivial_ctor.h [modify] https://crrev.com/11cb6892af5990d0e4430a8624d5643a1d658d46/tools/clang/plugins/tests/virtual_bodies.h
,
Nov 11 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/59b560a688614d2d283ff12f8b36e2fc29d92932 commit 59b560a688614d2d283ff12f8b36e2fc29d92932 Author: palmer <palmer@chromium.org> Date: Fri Nov 11 01:47:28 2016 Improved check for trivial templates. This is a follow-up to/fix for https://codereview.chromium.org/2483973003 (Treat std::atomic_int as a trivial class member when checking for non-trivial classes.). BUG=663463 Review-Url: https://codereview.chromium.org/2490473007 Cr-Commit-Position: refs/heads/master@{#431450} [modify] https://crrev.com/59b560a688614d2d283ff12f8b36e2fc29d92932/tools/clang/plugins/FindBadConstructsConsumer.cpp [add] https://crrev.com/59b560a688614d2d283ff12f8b36e2fc29d92932/tools/clang/plugins/tests/trivial_ctor.cpp [add] https://crrev.com/59b560a688614d2d283ff12f8b36e2fc29d92932/tools/clang/plugins/tests/trivial_ctor.h [add] https://crrev.com/59b560a688614d2d283ff12f8b36e2fc29d92932/tools/clang/plugins/tests/trivial_ctor.txt
,
Nov 15 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d57e2e35e306be47b0dc96337a131c6e28f1c387 commit d57e2e35e306be47b0dc96337a131c6e28f1c387 Author: hans <hans@chromium.org> Date: Tue Nov 15 00:05:23 2016 Roll clang 284979-1:284979-2 (update style plugin) Ran `tools/clang/scripts/upload_revision.py 284979 2`. This doesn't change the Clang version, but picks up Chromium #431450 which contains a fix for the style plugin. BUG=663463 Review-Url: https://codereview.chromium.org/2493243002 Cr-Commit-Position: refs/heads/master@{#431999} [modify] https://crrev.com/d57e2e35e306be47b0dc96337a131c6e28f1c387/tools/clang/scripts/update.py
,
Nov 18 2016
Passing the long-term fix off to dcheng.
,
Oct 15
This came up for std::atomic<uint_fast8_t> here - https://chromium-review.googlesource.com/c/chromium/src/+/1278425/4/base/synchronization/atomic_flag.h#24 (Just adding a note). |
||
►
Sign in to add a comment |
||
Comment 1 by palmer@chromium.org
, Nov 8 2016