the LHS subexpression can be NULL. Patch provided by Nuno Lopes!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44328
91177308-0d34-0410-b5e6-
96231b3b80d8
}
void StmtPrinter::VisitConditionalOperator(ConditionalOperator *Node) {
PrintExpr(Node->getCond());
- OS << " ? ";
- PrintExpr(Node->getLHS());
- OS << " : ";
+
+ if (Node->getLHS()) {
+ OS << " ? ";
+ PrintExpr(Node->getLHS());
+ OS << " : ";
+ }
+ else { // Handle GCC extention where LHS can be NULL.
+ OS << " ?: ";
+ }
+
PrintExpr(Node->getRHS());
}