Author: dgregor
Date: Thu Jan 20 23:24:25 2011
New Revision: 123967

URL: http://llvm.org/viewvc/llvm-project?rev=123967&view=rev
Log:
More testing to C++0x [temp.deduct.call]p3

Modified:
    cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp

Modified: 
cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp?rev=123967&r1=123966&r2=123967&view=diff
==============================================================================
--- 
cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp 
(original)
+++ 
cfe/trunk/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp 
Thu Jan 20 23:24:25 2011
@@ -22,3 +22,25 @@
   X<Y> xy1 = f0(xvalue<Y>());
   X<Y&> xy2 = f0(lvalue<Y>());
 }
+
+template<typename T> X<T> f1(const T&&); // expected-note{{candidate function 
[with T = int] not viable: no known conversion from 'int' to 'int const &&' for 
1st argument}} \
+// expected-note{{candidate function [with T = Y] not viable: no known 
conversion from 'Y' to 'Y const &&' for 1st argument}}
+
+void test_f1() {
+  X<int> xi0 = f1(prvalue<int>());
+  X<int> xi1 = f1(xvalue<int>());
+  f1(lvalue<int>()); // expected-error{{no matching function for call to 'f1'}}
+  X<Y> xy0 = f1(prvalue<Y>());
+  X<Y> xy1 = f1(xvalue<Y>());
+  f1(lvalue<Y>()); // expected-error{{no matching function for call to 'f1'}}
+}
+
+namespace std_example {
+  template <class T> int f(T&&); 
+  template <class T> int g(const T&&); // expected-note{{candidate function 
[with T = int] not viable: no known conversion from 'int' to 'int const &&' for 
1st argument}}
+
+  int i;
+  int n1 = f(i);
+  int n2 = f(0);
+  int n3 = g(i); // expected-error{{no matching function for call to 'g'}}
+}


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to