Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
and discussions with Ted and Jordy.

llvm-svn: 114056
diff --git a/clang/lib/Checker/BugReporter.cpp b/clang/lib/Checker/BugReporter.cpp
index 5043d90..a3f4f03 100644
--- a/clang/lib/Checker/BugReporter.cpp
+++ b/clang/lib/Checker/BugReporter.cpp
@@ -1165,15 +1165,15 @@
       }
 
       if (const BlockEntrance *BE = dyn_cast<BlockEntrance>(&P)) {
-        if (const Stmt* S = BE->getFirstStmt()) {
-         if (IsControlFlowExpr(S)) {
-           // Add the proper context for '&&', '||', and '?'.
-           EB.addContext(S);
-         }
-         else
-           EB.addExtendedContext(PDB.getEnclosingStmtLocation(S).asStmt());
+        if (CFGStmt S = BE->getFirstElement().getAs<CFGStmt>()) {
+          if (IsControlFlowExpr(S)) {
+            // Add the proper context for '&&', '||', and '?'.
+            EB.addContext(S);
+          }
+          else
+            EB.addExtendedContext(PDB.getEnclosingStmtLocation(S).asStmt());
         }
-
+        
         break;
       }
     } while (0);