Clang source question around failing MSVC build

ParseDecl.cpp fails to compile with MSVC reporting the following error:

ParseDecl.cpp

compiler\llvm\tools\clang\lib\Parse\ParseDecl.cpp(2760) : error C2248: 'clang::A

STOwningResult::operator =’ : cannot access private member declared i

n class ‘clang::ASTOwningResult’

with

[

Destroyer=::up▲

]

compiler\llvm\tools\clang\include\clang/Parse/Ownership.h(411) : see dec

laration of ‘clang::ASTOwningResult::operator =’

with

[

Destroyer=::up▲

]

The problems comes with the following code:

} else if (Tok.isNot(tok::r_square)) {

// Note, in C89, this production uses the constant-expr production instead

// of assignment-expr. The only difference is that assignment-expr allows

// things like ‘=’ and ‘*=’. Sema rejects these in C89 mode because they

// are not i-c-e’s, so we don’t need to distinguish between the two here.

// Parse the constant-expression or assignment-expression now (depending

// on dialect).

if (getLang().CPlusPlus)

NumElements = ParseConstantExpression();

else

NumElements = ParseAssignmentExpression();

}

As far as I can tell this code should not compile because of the following code from Ownership.h:

template

class ASTOwningResult

{

ASTOwningResult(ASTOwningResult&); // DO NOT IMPLEMENT

ASTOwningResult& operator =(ASTOwningResult&); // DO NOT IMPLEMENT

Both the copy constructor and assignment operator are no implemented and restricted.

A fix for this seems to be:

} else if (Tok.isNot(tok::r_square)) {

// Note, in C89, this production uses the constant-expr production instead

// of assignment-expr. The only difference is that assignment-expr allows

// things like ‘=’ and ‘*=’. Sema rejects these in C89 mode because they

// are not i-c-e’s, so we don’t need to distinguish between the two here.

// Parse the constant-expression or assignment-expression now (depending

// on dialect).

if (getLang().CPlusPlus)

NumElements = OwningExprResult(ParseAssignmentExpression());

else

NumElements = OwningExprResult(ParseAssignmentExpression());

}

Is this correct or have I missed something?

Many thanks,

Ben