Debian Codegraph @

AspectC++/tests/StdCxx17/main.cc

raw
1 #include <iostream>
2 #include <cstdio>
3
4 using namespace std;
5
6 namespace N1::N2::N3 { // can nested namespaces be parsed?
7 void deeply_nested_function() {
8 cout << " output of deeply nested function" << endl;
9 }
10 }
11
12 using namespace N1::N2; // can nested namespaces be looked up?
13
14 namespace X1::X2 {}
15
16 namespace X1::X2::X3 {} // can an existing namespace be extended?
17
18 // can the parser deal with this kind of C++ 17 attribute definition?
19 [[using gnu: __const, returns_nonnull ]] void *some_func1() noexcept;
20 [[gnu::returns_nonnull ]] void *some_func2() noexcept;
21
22 int main() {
23 printf ("StdCxx17: Handling of new (C++17) language features\n");
24 printf ("===================================================\n");
25 N3::deeply_nested_function();
26 printf ("===================================================\n");
27 }
28
29 aspect ExecTracer {
30 advice execution ("% ...::%(...)" && !"% main(...)") : around () {
31 printf ("before %s\n", JoinPoint::signature ());
32 tjp->proceed ();
33 printf ("after %s\n", JoinPoint::signature ());
34 }
35 };