Mercurial > emacs
annotate test/cedet/tests/testtypedefs.cpp @ 108252:623b349bb7c2
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 06 May 2010 03:24:12 +0000 |
parents | 89eccb374dec |
children | 376148b31b5e |
rev | line source |
---|---|
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
1 // testtypedefs.cpp --- Sample with some fake bits out of std::string |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
2 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
3 // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
4 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
5 // Author: Eric M. Ludlam <eric@siege-engine.com> |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
6 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
7 // This file is part of GNU Emacs. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
8 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
9 // GNU Emacs is free software: you can redistribute it and/or modify |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
10 // it under the terms of the GNU General Public License as published by |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
11 // the Free Software Foundation, either version 3 of the License, or |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
12 // (at your option) any later version. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
13 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
14 // GNU Emacs is distributed in the hope that it will be useful, |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
17 // GNU General Public License for more details. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
18 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
19 // You should have received a copy of the GNU General Public License |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
20 // along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
21 |
104494 | 22 // Thanks Ming-Wei Chang for these examples. |
23 | |
24 namespace std { | |
25 template <T>class basic_string { | |
26 public: | |
27 void resize(int); | |
28 }; | |
29 } | |
30 | |
31 typedef std::basic_string<char> mstring; | |
32 | |
33 using namespace std; | |
34 typedef basic_string<char> bstring; | |
35 | |
36 int main(){ | |
37 mstring a; | |
38 a.// -1- | |
39 ; | |
40 // #1# ( "resize" ) | |
41 bstring b; | |
42 // It doesn't work here. | |
43 b.// -2- | |
44 ; | |
45 // #2# ( "resize" ) | |
46 return 0; | |
47 } | |
48 | |
49 // ------------------ | |
50 | |
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
51 class Bar |
104494 | 52 { |
53 public: | |
54 void someFunc() {} | |
55 }; | |
56 | |
57 typedef Bar new_Bar; | |
58 | |
59 template <class mytype> | |
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
60 class TBar |
104494 | 61 { |
62 public: | |
63 void otherFunc() {} | |
64 }; | |
65 | |
66 typedef TBar<char> new_TBar; | |
67 | |
68 int main() | |
69 { | |
70 new_Bar nb; | |
71 new_TBar ntb; | |
72 | |
73 nb.// -3- | |
74 ; | |
75 // #3# ("someFunc") | |
76 ntb.// -4- | |
77 ; | |
78 // #4# ("otherFunc") | |
79 return 0; | |
80 } | |
105377 | 81 |
82 // arch-tag: 5a841384-8685-4344-bf45-15d3db19a87b |