~ubuntu-branches/ubuntu/quantal/aspectc++/quantal

« back to all changes in this revision

Viewing changes to AspectC++/tests/AnonymousStuff/main.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
void f () {}
 
4
 
 
5
// TODO: Puma should detect a problem if g1 and g2 are both called g
 
6
namespace {
 
7
  void g1 () { f (); }
 
8
};
 
9
 
 
10
namespace {
 
11
  void g2 () { f (); g1 (); }
 
12
};
 
13
 
 
14
aspect Test {
 
15
  advice call("% f()") : before () {
 
16
    printf ("    call (\"%s\")\n", JoinPoint::signature ());
 
17
  }
 
18
  advice execution ("% ...::%(...)") : before () {
 
19
    // TODO: the signature of f, g1, and g2 should show the anonymous namespace
 
20
    printf ("  execution (\"%s\")\n", JoinPoint::signature ());
 
21
  }
 
22
};
 
23
 
 
24
int main() {
 
25
  printf ("AnonymousStuff: tests if ac++ can deal with anonymous classes,\n");
 
26
  printf ("                namespace, etc.\n");
 
27
  printf ("=============================================================\n");
 
28
  g1 ();
 
29
  g2 ();
 
30
  printf ("=============================================================\n");
 
31
  return 0; // TODO: it should also work without this return
 
32
}