When checking for name collision between a tag and a previously defined namespace, the collision occured even when the tag was in a different nested scope.
Fix it by taking into account the scope when checking for namespace-tag name collisions.

llvm-svn: 53667
diff --git a/clang/test/Sema/cxx-namespace.cpp b/clang/test/Sema/cxx-namespace.cpp
index df0fa25..62251d3 100644
--- a/clang/test/Sema/cxx-namespace.cpp
+++ b/clang/test/Sema/cxx-namespace.cpp
@@ -14,6 +14,10 @@
 void C(); // expected-error {{error: previous definition is here}}
 namespace C {} // expected-error {{error: redefinition of 'C' as different kind of symbol}}
 
+namespace D {
+  class D {};
+}
+
 namespace S1 {
   int x;