From: xscript Date: Fri, 29 Apr 2011 00:32:56 +0000 (+0200) Subject: Move tests in cedet/semantic X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ceb9293fb83677dc3351a68eb42994d5265d439e;p=emacs.git Move tests in cedet/semantic --- 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 00000000000..6bc27b97208 --- /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 +struct grammar { +public: + typedef grammar self_t; + typedef DerivedT const& embed_t; + grammar() {} + ~grammar() { } + void use_parser() const { } + void test1() { } +}; + +struct PDFbool_parser : public grammar { + PDFbool_parser() {} + template 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 struct Base { +public: + void interface() + { + // ... + static_cast(this)->implementation(); + // ... + } + + static void static_func() + { + // ... + Derived::static_sub_func(); + // ... + } +}; + +struct Derived : Base { + void implementation() { } + static void static_sub_func() { } +}; + +int foo () { + Derived d; + d.//-2- + ; + // #2# ("implementation" "interface" "static_func" "static_sub_func") +}