Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-28 Thread Dmitry Polukhin via cfe-commits
Reverted in r267865. On Wed, Apr 27, 2016 at 10:31 PM, Dmitry Polukhin wrote: > So it seems that there is an agreement that Clang don't need this MSVC > "feature" so I'll revert my patch tomorrow when I get to the office. > > On Wed, Apr 27, 2016 at 10:09 PM, Stephan

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-27 Thread Dmitry Polukhin via cfe-commits
So it seems that there is an agreement that Clang don't need this MSVC "feature" so I'll revert my patch tomorrow when I get to the office. On Wed, Apr 27, 2016 at 10:09 PM, Stephan T. Lavavej < s...@exchange.microsoft.com> wrote: > [Richard Smith] > > You can find a description of the problem

RE: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-27 Thread Stephan T. Lavavej via cfe-commits
[Richard Smith] > You can find a description of the problem in http://llvm.org/PR27337 > Brief summary: > The WTL bug is the missing 'public' on the second base class on this line: > https://sourceforge.net/p/wtl/code/HEAD/tree/trunk/wtl/Samples/MDIDocVw/mainfrm.h#l636 > The C1xx bug is that it

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-27 Thread Richard Smith via cfe-commits
On Wed, Apr 27, 2016 at 11:52 AM, Richard Smith wrote: > On Wed, Apr 27, 2016 at 11:50 AM, Stephan T. Lavavej via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> [Dmitry Polukhin] >> > As for 'A*' to 'B*" case, indeed it is not very common and it looks >> like

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-27 Thread Richard Smith via cfe-commits
On Wed, Apr 27, 2016 at 11:50 AM, Stephan T. Lavavej via cfe-commits < cfe-commits@lists.llvm.org> wrote: > [Dmitry Polukhin] > > As for 'A*' to 'B*" case, indeed it is not very common and it looks like > someone just forgot to specify 'public'. > > If we're doing something gratuitously

RE: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-27 Thread Stephan T. Lavavej via cfe-commits
[Dmitry Polukhin] > As for 'A*' to 'B*" case, indeed it is not very common and it looks like > someone just forgot to specify 'public'. If we're doing something gratuitously nonconformant in MS product code or even sample code, you should report it to us, so we can fix it upstream, instead of

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-27 Thread Nico Weber via cfe-commits
Is it needed to parse system headers? In general, we implement things like this if they're needed for system headers but don't otherwise. On Wed, Apr 27, 2016 at 6:19 AM, Dmitry Polukhin via cfe-commits < cfe-commits@lists.llvm.org> wrote: > I added example with 'B*' to 'A*' just to make sure

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-27 Thread Dmitry Polukhin via cfe-commits
I added example with 'B*' to 'A*' just to make sure that my patch doesn't break it accidentally in MSVC mode. As for 'A*' to 'B*" case, indeed it is not very common and it looks like someone just forgot to specify 'public'. I tried to find more real world examples in public source codes but

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-26 Thread Richard Smith via cfe-commits
On Tue, Apr 26, 2016 at 7:04 PM, David Majnemer via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Visual Studio 2015 (19.00.23720.0) reports: > > error C2243: 'static_cast': conversion from 'B *' to 'A *' exists, but is > inaccessible > Right, it's the other direction ('A *' to 'B *') that

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-26 Thread David Majnemer via cfe-commits
Visual Studio 2015 (19.00.23720.0) reports: error C2243: 'static_cast': conversion from 'B *' to 'A *' exists, but is inaccessible On Tue, Apr 26, 2016 at 6:33 PM, Richard Smith via cfe-commits < cfe-commits@lists.llvm.org> wrote: > As noted in PR27337, this only occurs in one WTL sample, and

Re: r267534 - [MSVC] PR27337: allow static_cast from private base to derived for WTL

2016-04-26 Thread Richard Smith via cfe-commits
As noted in PR27337, this only occurs in one WTL sample, and we have no evidence that it actually occurs in real code. Have you seen uses of this in the wild? We generally don't want to add compatibility for MSVC bugs unless there's some real-world motivation. On Tue, Apr 26, 2016 at 2:21 AM,