aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-declref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/instantiate-declref.cpp')
-rw-r--r--test/SemaTemplate/instantiate-declref.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-declref.cpp b/test/SemaTemplate/instantiate-declref.cpp
index 051c6050abea..359e2c7dfaa4 100644
--- a/test/SemaTemplate/instantiate-declref.cpp
+++ b/test/SemaTemplate/instantiate-declref.cpp
@@ -69,3 +69,21 @@ namespace N2 {
template struct N2::Outer2::Inner<float>;
template struct N2::Outer2::Inner<int*, float*>; // expected-note{{instantiation}}
+
+// Test dependent pointer-to-member expressions.
+template<typename T>
+struct smart_ptr {
+ struct safe_bool {
+ int member;
+ };
+
+ operator int safe_bool::*() const {
+ return ptr? &safe_bool::member : 0;
+ }
+
+ T* ptr;
+};
+
+void test_smart_ptr(smart_ptr<int> p) {
+ if (p) { }
+}