diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2012-02-09 22:16:56 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2012-02-09 22:16:56 +0000 |
commit | 3e78b19e51034dd27c6e0d811522148345e299e4 (patch) | |
tree | 51f9ec0916a75259381460ee6c8d465656973b6b /lib/Sema/SemaInit.cpp | |
parent | 3964e62786b0912fecc82d776daac236e05fc792 (diff) |
Switching to using dyn_cast_or_null, and fixing line endings in the test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 759fb16d1a..6fff123b7a 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -1511,8 +1511,8 @@ static IndirectFieldDecl *FindIndirectFieldDesignator(FieldDecl *AnonField, IdentifierInfo *FieldName) { assert(AnonField->isAnonymousStructOrUnion()); Decl *NextDecl = AnonField->getNextDeclInContext(); - IndirectFieldDecl *IF = NULL; - while (NextDecl && (IF = dyn_cast<IndirectFieldDecl>(NextDecl))) { + while (IndirectFieldDecl *IF = + dyn_cast_or_null<IndirectFieldDecl>(NextDecl)) { if (FieldName && FieldName == IF->getAnonField()->getIdentifier()) return IF; NextDecl = NextDecl->getNextDeclInContext(); |