[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:53:11 PST 2012


> > +  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.
> 
So this actually turns out to be a problem with the way you implemented the parser. The parser just returns after parsing the braced list, but the function that called it (ParseExpression) doesn't know that the expression MUST end and happily calls ParseRHSOfBinaryOp again (with Prec::Comma). Thus, we parse the above as
(a = { 1 }) = b;
which, while weird, is perfectly valid.

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


More information about the cfe-commits mailing list