summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/undefined-internal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/undefined-internal.cpp')
-rw-r--r--clang/test/SemaCXX/undefined-internal.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/undefined-internal.cpp b/clang/test/SemaCXX/undefined-internal.cpp
index a7e92499657..e926f18d5ff 100644
--- a/clang/test/SemaCXX/undefined-internal.cpp
+++ b/clang/test/SemaCXX/undefined-internal.cpp
@@ -105,3 +105,20 @@ namespace test6 {
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}}
+ };
+}
OpenPOWER on IntegriCloud