aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/class.access/p4.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-01-28 07:38:46 +0000
committerJohn McCall <rjmccall@apple.com>2010-01-28 07:38:46 +0000
commit233a6419097ed97b67ff8efcacef9af613262ca3 (patch)
tree00e7ad62e4b8dd64ae39663f04d14e3812292a00 /test/CXX/class.access/p4.cpp
parentd93256e55673a17d18543397ec462416acb13792 (diff)
Access control for surrogate function calls. Required a moderately gross hack
to get the access bits set properly in conversion sets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/class.access/p4.cpp')
-rw-r--r--test/CXX/class.access/p4.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CXX/class.access/p4.cpp b/test/CXX/class.access/p4.cpp
index 0df17919a3..97c632a072 100644
--- a/test/CXX/class.access/p4.cpp
+++ b/test/CXX/class.access/p4.cpp
@@ -39,15 +39,21 @@ namespace test1 {
void operator+(Public&);
void operator[](Public&);
void operator()(Public&);
+ typedef void (*PublicSurrogate)(Public&);
+ operator PublicSurrogate() const;
protected:
void operator+(Protected&); // expected-note {{declared protected here}}
void operator[](Protected&); // expected-note {{declared protected here}}
void operator()(Protected&); // expected-note {{declared protected here}}
+ typedef void (*ProtectedSurrogate)(Protected&);
+ operator ProtectedSurrogate() const; // expected-note {{declared protected here}}
private:
void operator+(Private&); // expected-note {{declared private here}}
void operator[](Private&); // expected-note {{declared private here}}
void operator()(Private&); // expected-note {{declared private here}}
void operator-(); // expected-note {{declared private here}}
+ typedef void (*PrivateSurrogate)(Private&);
+ operator PrivateSurrogate() const; // expected-note {{declared private here}}
};
void operator+(const A &, Public&);
void operator+(const A &, Protected&);
@@ -71,5 +77,9 @@ namespace test1 {
ca + prot;
ca + priv;
-ca;
+ // These are all surrogate calls
+ ca(pub);
+ ca(prot); // expected-error {{access to protected member}}
+ ca(priv); // expected-error {{access to private member}}
}
}