summaryrefslogtreecommitdiffstats
path: root/build/clang-plugin/tests/TestNoPrincipalGetUri.cpp
blob: c94a2add8afc4fc789ab925a9cf152a7d49dfdc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class nsIPrincipal {
public:
  void GetURI(int foo){};
};

class SomePrincipal : public nsIPrincipal {
public:
  void GetURI(int foo) {}
};

class NullPrincipal : public SomePrincipal {};

class SomeURI {
public:
  void GetURI(int foo) {}
};

void f() {
  nsIPrincipal *a = new SomePrincipal();
  a->GetURI(0); //  expected-error {{Principal->GetURI is deprecated and will be removed soon. Please consider using the new helper functions of nsIPrincipal}}

  ::nsIPrincipal *b = new NullPrincipal();
  b->GetURI(0); //  expected-error {{Principal->GetURI is deprecated and will be removed soon. Please consider using the new helper functions of nsIPrincipal}}

  SomeURI *c = new SomeURI();
  c->GetURI(0);

  SomePrincipal *d = new SomePrincipal();
  d->GetURI(0);

}