Introduce ScopedDecl::getLexicalDeclContext() which is different from ScopedDecl::getDeclContext() when there are nested-names.
e.g.:
  namespace A {
    void f(); // SemanticDC (getDeclContext) == LexicalDC (getLexicalDeclContext) == 'namespace A'
  }
  void A::f(); // SemanticDC == namespace 'A'
               // LexicalDC == global namespace

llvm-svn: 58948
diff --git a/clang/test/SemaCXX/nested-name-spec.cpp b/clang/test/SemaCXX/nested-name-spec.cpp
index bbca04c..cf0500d 100644
--- a/clang/test/SemaCXX/nested-name-spec.cpp
+++ b/clang/test/SemaCXX/nested-name-spec.cpp
@@ -42,6 +42,15 @@
 struct S : public A::C {};
 struct A::undef; // expected-error {{'undef' does not name a tag member in the specified scope}}
 
+namespace A2 {
+  typedef int INT;
+  struct RC;
+}
+
+struct A2::RC {
+  INT x;
+};
+
 void f3() {
   N::x = 0; // expected-error {{use of undeclared identifier 'N'}}
   int N;