From: Argyrios Kyrtzidis Date: Tue, 21 Jul 2009 00:06:27 +0000 (+0000) Subject: Add an assertion for the return value of Decl::getNextRedeclaration(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22cbd2b794676c3b29c2b401c26730ed7047809e;p=clang Add an assertion for the return value of Decl::getNextRedeclaration(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76511 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index dc34c42034..c488d1c7a0 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -352,6 +352,7 @@ public: assert(Current && "Advancing while iterator has reached end"); // Get either previous decl or latest decl. Decl *Next = Current->getNextRedeclaration(); + assert(Next && "Should return next redeclaration or itself, never null!"); Current = (Next != Starter ? Next : 0); return *this; }