[cfe-dev] MSVC Ownership.h patch

Douglas Gregor dgregor at apple.com
Thu Jun 25 07:49:43 PDT 2009

On Jun 25, 2009, at 1:05 AM, AlisdairM(public) wrote:

> Attached is a potential patch for fixing a move semantics bug with  
> Visual Studio 2008 Express.  It needs a little attention before  
> applying, not least a correct version check for the compiler.   
> However, I am uncomfortable about a couple of things.
> i/ so far, no-one but me has reported the issue - is it something  
> else with my setup?
> ii/ ASTMultiPtr is not the only type using this idiom in this way,  
> but is so far the only one needing patching.
> iii/ Solving by casting could simply be hiding a deeper problem that  
> the two types with the same name really are distinct to MSVC for  
> some reason.
> iv/ I don't like being the one to set a precedent of introducing  
> compiler-specific fixes.
> v/ This code is way too ugly to be used as mainline code, and kind  
> of demands a version-specific check or dropping support for the  
> compiler!
> In the meantime, I propose to use this patch on my own system as it  
> allows me to continue testing.
> I'll take advice on whether/how it is worth cleaning up and applying  
> to the trunk.

Well, we can't drop support for Visual C++ over a little bug like  
this. I'm perfectly happy to put your patch into Clang once it has a  
proper version check. This stuff will clean itself up once rvalue  
references become more prevalent.

	- Doug

More information about the cfe-dev mailing list