]> git.eshelyaron.com Git - emacs.git/commitdiff
Move tests in cedet/semantic
authorxscript <xscript@users.sourceforge.net>
Fri, 29 Apr 2011 00:32:56 +0000 (02:32 +0200)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 15:48:36 +0000 (17:48 +0200)
test/manual/cedet/cedet/semantic/tests/testnsp.cpp [new file with mode: 0644]

diff --git a/test/manual/cedet/cedet/semantic/tests/testnsp.cpp b/test/manual/cedet/cedet/semantic/tests/testnsp.cpp
new file mode 100644 (file)
index 0000000..f2ed0e4
--- /dev/null
@@ -0,0 +1,59 @@
+// Test NSP (Name space parent)
+//
+// Test dereferencing parents based on local parent scope.
+//
+// Derived from data David Engster provided.
+
+namespace nsp {
+
+  class rootclass {
+  public:
+    int fromroot() {};
+  };
+
+}
+
+namespace nsp {
+  class childclass : public rootclass {
+  public:
+    int fromchild() {};
+  };
+}
+
+void myfcn_not_in_ns (void) {
+  nsp::childclass test;
+
+  test.// -1-
+    ; // #1# ( "fromchild" "fromroot" )
+}
+
+// Test a class declared in a class, where the contents
+// are in a qualified name.
+//
+// Thanks Michael Reiher for the concise example.
+
+class AAA
+{
+public:
+  AAA();
+
+  void aaa();
+
+private:
+    class Private;
+    Private * const d;
+};
+
+class AAA::Private
+{
+    Private() : bbb(0) {
+    }
+
+    BBB* bbb;
+};
+
+void AAA::aaa()
+{
+  d->// -2-
+    ; // #2# ( "bbb" )
+}