[cfe-commits] r135026 - in /cfe/trunk: lib/AST/Expr.cpp test/Sema/bitfield.c
Eli Friedman
eli.friedman at gmail.com
Tue Jul 12 19:05:57 PDT 2011
Author: efriedma
Date: Tue Jul 12 21:05:57 2011
New Revision: 135026
URL: http://llvm.org/viewvc/llvm-project?rev=135026&view=rev
Log:
Silliness with commas, as reported at http://blog.regehr.org/archives/558 . As it turns out, this is my fault for not noticing this was an issue when I was looking at this a long time ago. :(
Modified:
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/test/Sema/bitfield.c
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=135026&r1=135025&r2=135026&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Tue Jul 12 21:05:57 2011
@@ -2529,10 +2529,14 @@
if (Field->isBitField())
return Field;
- if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(E))
+ if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(E)) {
if (BinOp->isAssignmentOp() && BinOp->getLHS())
return BinOp->getLHS()->getBitField();
+ if (BinOp->getOpcode() == BO_Comma && BinOp->getRHS())
+ return BinOp->getRHS()->getBitField();
+ }
+
return 0;
}
Modified: cfe/trunk/test/Sema/bitfield.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/bitfield.c?rev=135026&r1=135025&r2=135026&view=diff
==============================================================================
--- cfe/trunk/test/Sema/bitfield.c (original)
+++ cfe/trunk/test/Sema/bitfield.c Tue Jul 12 21:05:57 2011
@@ -32,6 +32,7 @@
struct {unsigned x : 2;} x2;
__typeof__((x.x+=1)+1) y;
+__typeof__((0,x.x)+1) y;
__typeof__(x.x<<1) y;
int y;
More information about the cfe-commits
mailing list