diff options
author | Axel Naumann <Axel.Naumann@cern.ch> | 2011-01-24 15:44:00 +0000 |
---|---|---|
committer | Axel Naumann <Axel.Naumann@cern.ch> | 2011-01-24 15:44:00 +0000 |
commit | 274f83c2ece9041a1994fc3eacfe812ca86095e8 (patch) | |
tree | ec29016e257ea74ee7e4338bac58dc152198903c | |
parent | 2594bf96dc109c14e7c48f144d471d22cf1012c3 (diff) |
Check whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before accessing it, both for consistency (see StmtPrinter::VisitDeclRefExpr()) and for other use cases of dependent types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124119 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 4c18a526bb..cea3173eb6 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -481,7 +481,8 @@ void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) { 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( |