Fix more try scoping bugs introduced by r167650.

Introduces more clear scoping flags & flag combinations which should hopefully
be more understandable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167766 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index 0093915..7d55304 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -135,16 +135,13 @@
       // of the controlled statement.
       //
       assert(S->getParent() && "No TUScope?");
-      if (S->getFlags() & Scope::FnTryScope)
-        return S->getParent()->isDeclScope(D);
       if (S->getParent()->getFlags() & Scope::ControlScope) {
-        if (S->getParent()->getFlags() & Scope::FnCatchScope) {
-          S = S->getParent();
-          if (S->isDeclScope(D))
-            return true;
-        }
-        return S->getParent()->isDeclScope(D);
+        S = S->getParent();
+        if (S->isDeclScope(D))
+          return true;
       }
+      if (S->getFlags() & Scope::FnTryCatchScope)
+        return S->getParent()->isDeclScope(D);
     }
     return false;
   }