[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-07-03 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL307045: [clang] Implement -Wcast-qual for C++ (authored by lebedevri). Changed prior to commit: https://reviews.llvm.org/D33102?vs=105103&id=105108#toc Repository: rL LLVM https://reviews.llvm.org/D

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-07-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 105103. lebedev.ri added a comment. Rebased before commit. Repository: rL LLVM https://reviews.llvm.org/D33102 Files: docs/ReleaseNotes.rst lib/Sema/SemaCast.cpp test/Sema/warn-cast-qual.c test/SemaCXX/warn-cast-qual.cpp Index: test/SemaCXX/w

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-07-03 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Will land this shortly.. Repository: rL LLVM https://reviews.llvm.org/D33102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-14 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists added a comment. As of r305410, libc++ passes all the tests w/ -Wcast-qual enabled. Repository: rL LLVM https://reviews.llvm.org/D33102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-12 Thread David Blaikie via cfe-commits
Yeah, looks like the UB is baked in pretty deep here, so it's not reasonable to try to fix it just because of this. I'd probably suggest trying making that cast in PointerUnion.h into a reinterpret cast? Would that suffice to address the const issues? Otherwise a const_cast + reinterpret_cast?

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-12 Thread Roman Lebedev via cfe-commits
On Mon, Jun 12, 2017 at 8:16 PM, David Blaikie wrote: > > > On Mon, Jun 12, 2017 at 10:10 AM Roman Lebedev via Phabricator > wrote: >> >> lebedev.ri added a comment. >> >> So i'm trying to analyze that stage2 warning. > > > Could you link to the buildbot failure to see the original LLVM project c

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-12 Thread David Blaikie via cfe-commits
On Mon, Jun 12, 2017 at 10:10 AM Roman Lebedev via Phabricator < revi...@reviews.llvm.org> wrote: > lebedev.ri added a comment. > > So i'm trying to analyze that stage2 warning. > Could you link to the buildbot failure to see the original LLVM project code triggering this situation? > The testc

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-12 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. So i'm trying to analyze that stage2 warning. The testcase //seems// to be: (autogenerated all the variants) void test_nop() { unsigned char **ptr1 = 0; void **ptr2 = (void **)ptr1; } void test_bad() { unsigned char **ptr1 = 0; const void **ptr2 =

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-10 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL305147: [clang] Implement -Wcast-qual for C++ (authored by lebedevri). Changed prior to commit: https://reviews.llvm.org/D33102?vs=102119&id=102120#toc Repository: rL LLVM https://reviews.llvm.org/D

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 102119. lebedev.ri edited the summary of this revision. lebedev.ri added a comment. This revision is now accepted and ready to land. After further mail exchange, i will proceed to commit this as-is. No code changes, rebase before commit. Repository: rL

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-10 Thread Roman Lebedev via cfe-commits
On Sat, Jun 10, 2017 at 7:05 PM, David Blaikie wrote: > > > On Sat, Jun 10, 2017 at 3:33 AM Roman Lebedev via Phabricator > wrote: >> >> lebedev.ri planned changes to this revision. >> lebedev.ri added a comment. >> >> In https://reviews.llvm.org/D33102#773296, @dblaikie wrote: >> >> > But sure.

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-10 Thread David Blaikie via cfe-commits
On Sat, Jun 10, 2017 at 3:33 AM Roman Lebedev via Phabricator < revi...@reviews.llvm.org> wrote: > lebedev.ri planned changes to this revision. > lebedev.ri added a comment. > > In https://reviews.llvm.org/D33102#773296, @dblaikie wrote: > > > But sure. Could you also (manually, I guess) confirm t

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri planned changes to this revision. lebedev.ri added a comment. In https://reviews.llvm.org/D33102#773296, @dblaikie wrote: > But sure. Could you also (manually, I guess) confirm that this matches GCC's > cast-qual behavior (insofar as the warning fires in the same situations). If > th

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-09 Thread Roman Lebedev via cfe-commits
On Fri, Jun 9, 2017 at 11:28 PM, David Blaikie wrote: > Looks all good OK, thank you. > please commit whenever you're ready - if you don't have > commit access, I (or anyone else with commit access) can commit this for > you. Will re-test and commit in +~12 hours. > On Tue, Jun 6, 2017 at 1:57 P

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-09 Thread David Blaikie via cfe-commits
Looks all good, please commit whenever you're ready - if you don't have commit access, I (or anyone else with commit access) can commit this for you. On Tue, Jun 6, 2017 at 1:57 PM Roman Lebedev wrote: > On Tue, Jun 6, 2017 at 8:52 PM, David Blaikie wrote: > > > > > > On Tue, Jun 6, 2017 at 3:5

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-06 Thread Roman Lebedev via cfe-commits
On Tue, Jun 6, 2017 at 8:52 PM, David Blaikie wrote: > > > On Tue, Jun 6, 2017 at 3:59 AM Roman Lebedev via Phabricator > wrote: >> >> lebedev.ri added a comment. >> >> In https://reviews.llvm.org/D33102#773296, @dblaikie wrote: >> >> > I still feel like that's more testing than would be ideal (d

Re: [PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-06 Thread David Blaikie via cfe-commits
On Tue, Jun 6, 2017 at 3:59 AM Roman Lebedev via Phabricator < revi...@reviews.llvm.org> wrote: > lebedev.ri added a comment. > > In https://reviews.llvm.org/D33102#773296, @dblaikie wrote: > > > I still feel like that's more testing than would be ideal (does the > context of the cast matter? Weth

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-06 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. (tested with: gcc version 6.3.0 20170516 (Debian 6.3.0-18) ```) Repository: rL LLVM https://reviews.llvm.org/D33102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/li

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-06 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D33102#773296, @dblaikie wrote: > I still feel like that's more testing than would be ideal (does the context > of the cast matter? Wether it's dereferenced, a struct member access, > assigned, initialized, etc - it doesn't look like it fr

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-05 Thread David Blaikie via Phabricator via cfe-commits
dblaikie accepted this revision. dblaikie added a comment. This revision is now accepted and ready to land. I still feel like that's more testing than would be ideal (does the context of the cast matter? Wether it's dereferenced, a struct member access, assigned, initialized, etc - it doesn't lo

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-02 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D33102#767291, @dblaikie wrote: > Still seems like an awful lot more testing than I'd expect for this warning. > (eg: testing all the many variations of C++ const_cast - when they all > provide basically the same coverage I think, that al

[PATCH] D33102: [clang] Implement -Wcast-qual for C++

2017-06-02 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 101232. lebedev.ri marked an inline comment as done. lebedev.ri added a subscriber: cfe-commits. lebedev.ri added a comment. Address review notes. Repository: rL LLVM https://reviews.llvm.org/D33102 Files: docs/ReleaseNotes.rst lib/Sema/SemaCast.c