]> git.eshelyaron.com Git - emacs.git/commitdiff
C++: Deal with 'using' statements when calculating scope
authorDavid Engster <dengste@eml.cc>
Mon, 18 Nov 2013 22:11:17 +0000 (23:11 +0100)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 17:28:21 +0000 (19:28 +0200)
* semantic/bovine/c.el (semantic-ctxt-scoped-types): Go through all
  tags around point and search them for using statements.  Before, we
  skipped the last one thinking that it would have to be function, but
  it could also be a type.

* semantic/scope.el (semantic-completable-tags-from-type): When
  creating the list of completable types, pull in types which are
  referenced through 'using' statements.

* tests/cedet/semantic/test/manual/cedet/testusing.cpp:
* tests/cedet/semantic/test/manual/cedet/testusing.hh: Add tests for
  the above.

test/manual/cedet/cedet/semantic/tests/testusing.hh

index 61b5d08e106888be0bf6a63a9fa58c969b1ad523..471891a88d4bd95552322c8b3134fe61975ae7a2 100644 (file)
@@ -123,6 +123,22 @@ namespace outer {
   }
 }
 
+// Namespace which pulls in one of its own nested namespaces
+namespace first {
+  class AAA1;
+  namespace second {
+    class AAA2;
+  }
+  // Elevate nested namespace into first one
+  using namespace second;
+}
+
+namespace third {
+  using namespace first;
+  class AAA3;
+}
+
+
 // Elevate the first struct into 'outer'
 // so that we can access it via 'outer::StructNested'
 namespace outer {