summaryrefslogtreecommitdiff
path: root/test/SemaCXX/undefined-internal.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-02-26 22:09:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-02-26 22:09:03 +0000
commitc3b054d250cdca485c71845089c316e10610ebad (patch)
treeabae0246ec9156cc1a7cbb947b2b0dfe95fa3189 /test/SemaCXX/undefined-internal.cpp
parentbca07a4524feb4edec581062d631a13116320a24 (diff)
Notes
Diffstat (limited to 'test/SemaCXX/undefined-internal.cpp')
-rw-r--r--test/SemaCXX/undefined-internal.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/SemaCXX/undefined-internal.cpp b/test/SemaCXX/undefined-internal.cpp
index bb87ce0f126cc..e926f18d5ff21 100644
--- a/test/SemaCXX/undefined-internal.cpp
+++ b/test/SemaCXX/undefined-internal.cpp
@@ -84,3 +84,41 @@ namespace test5 {
B<A>::foo(); // expected-note {{used here}}
}
}
+
+namespace test6 {
+ template <class T> struct A {
+ static const int zero = 0;
+ static const int one = 1;
+ static const int two = 2;
+
+ int value;
+
+ A() : value(zero) {
+ value = one;
+ }
+ };
+
+ namespace { struct Internal; }
+
+ void test() {
+ A<Internal> a;
+ a.value = A<Internal>::two;
+ }
+}
+
+// We support (as an extension) private, undefined copy constructors when
+// a temporary is bound to a reference even in C++98. Similarly, we shouldn't
+// warn about this copy constructor being used without a definition.
+namespace PR9323 {
+ namespace {
+ struct Uncopyable {
+ Uncopyable() {}
+ private:
+ Uncopyable(const Uncopyable&); // expected-note {{declared private here}}
+ };
+ }
+ void f(const Uncopyable&) {}
+ void test() {
+ f(Uncopyable()); // expected-warning {{C++98 requires an accessible copy constructor}}
+ };
+}