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. :(
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135026 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 5d8789f..4611ae3 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -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;
}