summaryrefslogtreecommitdiffstats
path: root/test/CXX/class.access/p4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/class.access/p4.cpp')
-rw-r--r--test/CXX/class.access/p4.cpp62
1 files changed, 60 insertions, 2 deletions
diff --git a/test/CXX/class.access/p4.cpp b/test/CXX/class.access/p4.cpp
index 115a22a..84b7b19 100644
--- a/test/CXX/class.access/p4.cpp
+++ b/test/CXX/class.access/p4.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fexceptions -fsyntax-only -verify %s
// C++0x [class.access]p4:
@@ -201,7 +201,7 @@ namespace test4 {
// Implicit copy assignment operator uses.
namespace test5 {
class A {
- void operator=(const A &); // expected-note 2 {{declared private here}}
+ void operator=(const A &); // expected-note 2 {{implicitly declared private here}}
};
class Test1 { A a; }; // expected-error {{private member}}
@@ -450,3 +450,61 @@ namespace test18 {
A<int> member;
};
}
+
+// PR8325
+namespace test19 {
+ class A { ~A(); };
+ // The destructor is not implicitly referenced here. Contrast to test16,
+ // testing PR7281, earlier in this file.
+ void b(A* x) { throw x; }
+}
+
+// PR7930
+namespace test20 {
+ class Foo {
+ Foo(); // expected-note {{implicitly declared private here}}
+ };
+ Foo::Foo() {}
+
+ void test() {
+ Foo a; // expected-error {{calling a private constructor}}
+ }
+}
+
+namespace test21 {
+ template <class T> class A {
+ void foo();
+ void bar();
+ class Inner; // expected-note {{implicitly declared private here}}
+ public:
+ void baz();
+ };
+ template <class T> class A<T>::Inner {};
+ class B {
+ template <class T> class A<T>::Inner;
+ };
+
+ void test() {
+ A<int>::Inner i; // expected-error {{'Inner' is a private member}}
+ }
+}
+
+namespace rdar8876150 {
+ struct A { operator bool(); };
+ struct B : private A { using A::operator bool; };
+
+ bool f() {
+ B b;
+ return !b;
+ }
+}
+
+namespace test23 {
+ template <typename T> class A {
+ A();
+ static A instance;
+ };
+
+ template <typename T> A<T> A<T>::instance;
+ template class A<int>;
+}
OpenPOWER on IntegriCloud