~ubuntu-branches/ubuntu/natty/aspectc++/natty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-12-23 10:49:40 UTC
  • Revision ID: james.westby@ubuntu.com-20051223104940-ig4klhoi991zs7km
Tags: upstream-0.99+1.0pre2
ImportĀ upstreamĀ versionĀ 0.99+1.0pre2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
class A {
 
4
public:
 
5
  A operator++ () {
 
6
    printf("inside A A::operator ++()\n");
 
7
    return *this;
 
8
  }
 
9
  A operator++ (int) {
 
10
    printf("inside A A::operator ++(int)\n");
 
11
    return *this;
 
12
  }
 
13
};
 
14
 
 
15
aspect PlusPlus {
 
16
  advice call ("% A::operator ++()") : before () {
 
17
    printf ("before %s\n", JoinPoint::signature ());
 
18
  }
 
19
  advice call ("% A::operator ++(int)") : before () {
 
20
    printf ("before %s\n", JoinPoint::signature ());
 
21
  }
 
22
};
 
23
 
 
24
int main() {
 
25
  printf ("Bug239: distinguish call advice for operator ++\n");
 
26
  printf ("===============================================\n");
 
27
  A a;
 
28
  a++;
 
29
  ++a;
 
30
  printf ("===============================================\n");
 
31
}