gtkutil.c (xg_modify_menubar_widgets): If menubar is totally empty
[emacs.git] / test / cedet / tests / testusing.cpp
blob3bd95a381133ea7b90cb4b1e206e11e2efb751ef
1 // Test using statements in C++
3 #include <adstdio.h>
5 #include <testusing.hh>
7 namespace moose {
9 class MyClass;
10 class Point;
12 typedef MyClass snerk;
15 namespace moose {
17 class Point;
18 class MyClass;
22 namespace {
24 int global_variable = 0;
28 using moose::MyClass;
30 void someFcn() {
32 MyClass f;
34 f.//-1-
35 ; //#1# ( "getVal" "setVal" )
39 // Code from Zhiqiu Kong
41 namespace panda {
43 using namespace bread_name;
45 int func()
47 bread test;
48 test.//-2-
49 ;// #2# ( "geta" )
50 return 0;
54 // Local using statements and aliased types
55 // Code from David Engster
57 void func2()
59 using namespace somestuff;
60 OneClass f;
61 f.//-3-
62 ; //#3# ( "aFunc" "anInt" )
65 void func3()
67 using somestuff::OneClass;
68 OneClass f;
69 f.//-4-
70 ; //#4# ( "aFunc" "anInt" )
73 // Dereferencing alias types created through 'using' statements
75 // Alias with fully qualified name
76 void func4()
78 otherstuff::OneClass f;
79 f. //-5-
80 ; //#5# ( "aFunc" "anInt" )
83 // Alias through namespace directive
84 void func5()
86 using namespace otherstuff;
87 OneClass f;
88 f. //-6-
89 ; //#6# ( "aFunc" "anInt" )
92 // Check name hiding
93 void func6()
95 using namespace morestuff;
96 OneClass f; // Alias for somestuff::OneClass
97 f. //-7-
98 ; //#7# ( "aFunc" "anInt" )
99 aStruct g; // This however is morestuff::aStruct !
100 g. //-8-
101 ; //#8# ( "anotherBar" "anotherFoo" )
104 // Alias of an alias
105 // Currently doesn't work interactively for some reason.
106 void func6()
108 using namespace evenmorestuff;
109 OneClass f;
110 f. //-7-
111 ; //#7# ( "aFunc" "anInt" )
114 // Alias for struct in nested namespace, fully qualified
115 void func7()
117 outer::StructNested f;
118 f.//-8-
119 ; //#8# ( "one" "two" )
122 // Alias for nested namespace
123 void func8()
125 using namespace outerinner;
126 StructNested f;
127 AnotherStruct g;
128 f.//-9-
129 ; //#9# ( "one" "two" )
130 g.//-10-
131 ; //#10# ( "four" "three" )
134 // arch-tag: 8e68d5d1-4d48-47c6-a910-d8d6b66b2768