Use getDeclName() instead of getIdentifier() (safe against null pointers)
llvm-svn: 68804
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index edbb018..898ecbb 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1362,7 +1362,7 @@
if (VDecl->getStorageClass() != VarDecl::Extern &&
VDecl->getStorageClass() != VarDecl::PrivateExtern)
Diag(VDecl->getLocation(), diag::err_objc_var_decl_inclass)
- << cast<NamedDecl>(ClassDecl)->getIdentifier();
+ << cast<NamedDecl>(ClassDecl)->getDeclName();
}
}
}