From bf84fd5bc5013037be4d6bf21d2ac8df0397cbfd Mon Sep 17 00:00:00 2001 From: xscript Date: Fri, 29 Apr 2011 02:32:56 +0200 Subject: [PATCH] Move tests in cedet/semantic --- .../cedet/cedet/semantic/tests/testnsp.cpp | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 test/manual/cedet/cedet/semantic/tests/testnsp.cpp diff --git a/test/manual/cedet/cedet/semantic/tests/testnsp.cpp b/test/manual/cedet/cedet/semantic/tests/testnsp.cpp new file mode 100644 index 00000000000..f2ed0e4af39 --- /dev/null +++ b/test/manual/cedet/cedet/semantic/tests/testnsp.cpp @@ -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" ) +} -- 2.39.2