annotate test/cedet/tests/scopetest.cpp @ 104508:90ca5d588aa9

* cedet/semantic.el: Add autoloads for semantic/idle functions. * cedet/semantic/util.el (semantic--completion-cache): New var. (semantic-symbol-start, semantic-find-tag-for-completion) (semantic-complete-symbol): New functions, adapted from Senator. * bindings.el (complete-symbol): Try semantic-complete-symbol if no tag table is active. * cedet/semantic/idle.el (define-semantic-idle-service): Doc fix.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 21 Sep 2009 15:59:48 +0000
parents e480034314ce
children 7f4c7f5c0eba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104494
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
1 /* Test scoping rules for c++ in the analyzer. */
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
3 namespace {
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5 class aclass2; // Forward reference.
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 class aclass1 {
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8 private:
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 int attrp1;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 int amethodp1(int argp1);
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 aclass2 areference;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 protected:
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13 int attrpr1;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 public:
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 int attr1;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 int amethod1(int arg1);
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 };
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18 }
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 namespace {
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21 class aclass2 : public aclass1
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 {
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23 private:
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 int attrp2;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 int amethodp2(int argp1);
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 public:
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 aclass2(int aninitvalue);
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 ~aclass2();
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29 int attr2;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 int amethod2(int arg2);
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 };
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 }
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34 aclass2::aclass2(init aninitvalue)
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 {
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 /* This is a comment that talks about aclass1 */
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 aclass1;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 }
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40 int aclass2::amethod2(int arg2)
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41 {
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 int alocalvar;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43 float q;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 ac;
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 }
e480034314ce Add Semantic unit tests.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47