[cfe-commits] r150629 - /cfe/trunk/lib/Sema/SemaLookup.cpp
Kaelyn Uhrain
rikka at google.com
Wed Feb 15 14:59:03 PST 2012
Author: rikka
Date: Wed Feb 15 16:59:03 2012
New Revision: 150629
URL: http://llvm.org/viewvc/llvm-project?rev=150629&view=rev
Log:
Silence a valgrind warning, and remove an unused var.
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=150629&r1=150628&r2=150629&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Wed Feb 15 16:59:03 2012
@@ -3335,8 +3335,6 @@
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 @@
// 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() ||
More information about the cfe-commits
mailing list