[cfe-commits] r151551 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/CXX/expr/expr.ass/p9-cxx11.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Mon Feb 27 14:04:20 PST 2012


On 27.02.2012, at 22:48, Richard Smith wrote:

> 
> On Feb 27, 2012 12:40 PM, "Sebastian Redl" <sebastian.redl at getdesigned.at> wrote:
> >
> > ==============================================================================
> > --- cfe/trunk/test/CXX/expr/expr.ass/p9-cxx11.cpp (original)
> > +++ cfe/trunk/test/CXX/expr/expr.ass/p9-cxx11.cpp Mon Feb 27 14:34:02 2012
> > @@ -11,10 +11,9 @@
> >   z = { 1, 2 };
> >   z += { 1, 2 };
> >
> > -  // FIXME: implement semantics of scalar init list assignment.
> >   int a, b;
> > -  a = b = { 1 }; // unexpected-error {{incompatible type 'void'}}
> > -  a = { 1 } = b; // unexpected-error {{incompatible type 'void'}}
> > +  a = b = { 1 };
> > +  a = { 1 } = b;
> 
> This is supposed to be ill-formed. How do we handle scalar compound assignments of braced-init-lists? My reading is that such assignments are also ill formed.
> 

You're right, the second line is supposed to be ill-formed, though I cannot figure out why it is accepted. Another thing to research.
Compound assignment with a braced-init-list on the RHS is valid.

I'll write more test cases.

Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120227/ab2ef6a7/attachment.html>


More information about the cfe-commits mailing list