emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/merge-cedet-tests ceb9293 130/316: Move tests in c


From: Edward John Steere
Subject: [Emacs-diffs] scratch/merge-cedet-tests ceb9293 130/316: Move tests in cedet/semantic
Date: Sat, 28 Jan 2017 09:09:54 +0000 (UTC)

branch: scratch/merge-cedet-tests
commit ceb9293fb83677dc3351a68eb42994d5265d439e
Author: xscript <address@hidden>
Commit: Edward John Steere <address@hidden>

    Move tests in cedet/semantic
---
 .../cedet/cedet/semantic/tests/teststruct.cpp      |   66 ++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/test/manual/cedet/cedet/semantic/tests/teststruct.cpp 
b/test/manual/cedet/cedet/semantic/tests/teststruct.cpp
new file mode 100644
index 0000000..6bc27b9
--- /dev/null
+++ b/test/manual/cedet/cedet/semantic/tests/teststruct.cpp
@@ -0,0 +1,66 @@
+// Combinations of templates and structure inheritance.
+//
+// Created by Alex Ott.
+
+template <typename DerivedT>
+struct grammar {
+public:
+  typedef grammar<DerivedT> self_t;
+  typedef DerivedT const& embed_t;
+  grammar() {}
+  ~grammar() { }
+  void use_parser() const { }
+  void test1() { }
+};
+
+struct PDFbool_parser : public grammar<PDFbool_parser> {
+  PDFbool_parser() {}
+  template <typename scannerT> struct definition {
+    typedef typename scannerT::iterator_t iterator_t;
+    int top;
+    definition(const PDFbool_parser& /*self*/) {
+      return ;
+    }
+    const int start() const {
+      return top;
+    }
+  };
+};
+
+int main(void) {
+  PDFbool_parser PDFbool_p = PDFbool_parser();
+  PDFbool_p.//-1-
+    ;
+  // #1# ("definition" "embed_t" "self_t" "test1" "use_parser")
+}
+
+// ----------------------------------------------------------------------
+
+template <class Derived> struct Base {
+public:
+  void interface()
+  {
+    // ...
+    static_cast<Derived*>(this)->implementation();
+    // ...
+  }
+
+  static void static_func()
+  {
+    // ...
+    Derived::static_sub_func();
+    // ...
+  }
+};
+
+struct Derived : Base<Derived> {
+  void implementation() { }
+  static void static_sub_func() { }
+};
+
+int foo () {
+  Derived d;
+  d.//-2-
+    ;
+  // #2# ("implementation" "interface" "static_func" "static_sub_func")
+}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]