6 typedef unsigned int my_uint_t
;
7 int i
; // Find the line number for anonymous namespace variable i.
15 variadic_sum (int arg_count
...)
19 va_start(args
, arg_count
);
21 for (int i
= 0; i
< arg_count
; i
++)
22 sum
+= va_arg(args
, int);
30 typedef unsigned int uint_t
;
32 typedef unsigned int uint_t
;
33 int j
; // Find the line number for named namespace variable j.
39 float myfunc (float f
)
48 typedef unsigned int uint_t
;
53 using A::B::j
; // using declaration
55 namespace Foo
= A::B
; // namespace alias
57 using Foo::myfunc
; // using declaration
59 using namespace Foo
; // using directive
76 void test_namespace_scopes() {
79 printf("ns1::value = %d\n", value
); // Evaluate ns1::value
84 printf("ns2::value = %d\n", value
); // Evaluate ns2::value
88 int Foo::myfunc(int a
)
90 test_namespace_scopes();
92 ::my_uint_t anon_uint
= 0;
98 printf("::i=%d\n", ::i
);
99 printf("A::B::j=%d\n", A::B::j
);
100 printf("variadic_sum=%d\n", variadic_sum(3, 1, 2, 3));
102 return myfunc2(3) + j
+ i
+ a
+ 2 + anon_uint
+ a_uint
+ b_uint
+ y_uint
; // Set break point at this line.
107 int x() { return 42; }
114 int y() { return 137; }
120 int bar() { return -2; }
122 } // namespace NS1::NS2
126 int bar() { return -3; }
131 main (int argc
, char const *argv
[])
133 test_lookup_at_global_scope();
134 test_lookup_at_file_scope();
135 A::test_lookup_at_ns_scope();
136 A::B::test_lookup_at_nested_ns_scope();
137 A::B::test_lookup_at_nested_ns_scope_after_using();
138 test_lookup_before_using_directive();
139 test_lookup_after_using_directive();
142 return Foo::myfunc(12) + bb
.x() + ab
.y() + NS1::NS2::Foo
{}.bar() +