aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2012-02-15 22:59:03 +0000
committerKaelyn Uhrain <rikka@google.com>2012-02-15 22:59:03 +0000
commit3ad02aa90105a9fcfd3d4328e800aa1362a90234 (patch)
treeec705af4478c89bd54992e88ee241e07376bf838 /lib/Sema/SemaLookup.cpp
parent0f163e964289bc18e9bc1ec37a6a01018ba62640 (diff)
Silence a valgrind warning, and remove an unused var.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r--lib/Sema/SemaLookup.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index ceb3dcaaed..81710d2043 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -3335,8 +3335,6 @@ void NamespaceSpecifierSet::AddNamespace(NamespaceDecl *ND) {
unsigned NumSpecifiers = 0;
DeclContextList NamespaceDeclChain(BuildContextChain(Ctx));
DeclContextList FullNamespaceDeclChain(NamespaceDeclChain);
- // The full size of NamespaceDeclChain before any common elements are removed
- DeclContextList::size_type FullSize = NamespaceDeclChain.size();
// Eliminate common elements from the two DeclContext chains.
for (DeclContextList::reverse_iterator C = CurContextChain.rbegin(),
@@ -3348,7 +3346,8 @@ void NamespaceSpecifierSet::AddNamespace(NamespaceDecl *ND) {
// Add an explicit leading '::' specifier if needed.
if (NamespaceDecl *ND =
- dyn_cast<NamespaceDecl>(NamespaceDeclChain.back())) {
+ NamespaceDeclChain.empty() ? NULL :
+ dyn_cast_or_null<NamespaceDecl>(NamespaceDeclChain.back())) {
IdentifierInfo *Name = ND->getIdentifier();
if (std::find(CurContextIdentifiers.begin(), CurContextIdentifiers.end(),
Name) != CurContextIdentifiers.end() ||