Author: axel
Date: Mon Jan 24 09:44:00 2011
New Revision: 124119

URL: http://llvm.org/viewvc/llvm-project?rev=124119&view=rev
Log:
Check whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before 
accessing it, both for consistency (see StmtPrinter::VisitDeclRefExpr()) and 
for other use cases of dependent types.

Modified:
    cfe/trunk/lib/AST/StmtPrinter.cpp

Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=124119&r1=124118&r2=124119&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Mon Jan 24 09:44:00 2011
@@ -481,7 +481,8 @@
 
 void StmtPrinter::VisitDependentScopeDeclRefExpr(
                                            DependentScopeDeclRefExpr *Node) {
-  Node->getQualifier()->print(OS, Policy);
+  if (NestedNameSpecifier *Qualifier = Node->getQualifier())
+    Qualifier->print(OS, Policy);
   OS << Node->getNameInfo();
   if (Node->hasExplicitTemplateArgs())
     OS << TemplateSpecializationType::PrintTemplateArgumentList(


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to