summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/conditional-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/conditional-expr.cpp')
-rw-r--r--clang/test/SemaCXX/conditional-expr.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/conditional-expr.cpp b/clang/test/SemaCXX/conditional-expr.cpp
index f1fe8ba79bb..a09ff2bd417 100644
--- a/clang/test/SemaCXX/conditional-expr.cpp
+++ b/clang/test/SemaCXX/conditional-expr.cpp
@@ -255,3 +255,23 @@ namespace test1 {
foo(a ? a->x() : 0);
}
}
+
+namespace rdar7998817 {
+ class X {
+ X(X&); // expected-note{{declared private here}}
+
+ struct ref { };
+
+ public:
+ X();
+ X(ref);
+
+ operator ref();
+ };
+
+ void f(bool B) {
+ X x;
+ (void)(B? x // expected-error{{calling a private constructor of class 'rdar7998817::X'}}
+ : X());
+ }
+}
OpenPOWER on IntegriCloud