Add ExplicitCastExpr to replace the current CastExpr, and have ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr):
Expr
-> CastExpr
-> ExplicitCastExpr
-> ImplicitCastExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54955 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index abcab9c..5b4c0ec 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -689,7 +689,10 @@
OS << ".";
OS << Node->getAccessor().getName();
}
-void StmtPrinter::VisitCastExpr(CastExpr *Node) {
+void StmtPrinter::VisitCastExpr(CastExpr *) {
+ assert(0 && "CastExpr is an abstract class");
+}
+void StmtPrinter::VisitExplicitCastExpr(ExplicitCastExpr *Node) {
OS << "(" << Node->getType().getAsString() << ")";
PrintExpr(Node->getSubExpr());
}