]> granicus.if.org Git - clang/commitdiff
Add a test from pr14898.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 12 Jan 2013 01:01:06 +0000 (01:01 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 12 Jan 2013 01:01:06 +0000 (01:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172283 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/linkage2.cpp

index 072dcd2413d09ad0a4b352efae921b0d38c98196..0adc7edca84b3ccd815b9769db971707f3275108 100644 (file)
@@ -48,3 +48,26 @@ namespace test5 {
     void g();
   }
 }
+
+// pr14898
+namespace test6 {
+  template <class _Rp>
+  class __attribute__ ((__visibility__("default"))) shared_future;
+  template <class _Rp>
+  class future {
+    template <class> friend class shared_future;
+    shared_future<_Rp> share();
+  };
+  template <class _Rp> future<_Rp>
+  get_future();
+  template <class _Rp>
+  struct shared_future<_Rp&> {
+    shared_future(future<_Rp&>&& __f); // expected-warning {{rvalue references are a C++11 extension}}
+  };
+  void f() {
+    typedef int T;
+    get_future<int>();
+    typedef int& U;
+    shared_future<int&> f1 = get_future<int&>();
+  }
+}