summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-27 22:31:44 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-27 22:31:44 +0000
commitedb76857124a7052c046add217ce5164fe2acc56 (patch)
tree8e846ecd5a095a68b2a71277891339ee950cc8d6 /clang/test
parent44dc127f7807b44b74d238c237738ca1853943db (diff)
downloadbcm5719-llvm-edb76857124a7052c046add217ce5164fe2acc56.tar.gz
bcm5719-llvm-edb76857124a7052c046add217ce5164fe2acc56.zip
Teach the evaluation of the __is_convertible_to trait to translate
access control errors into SFINAE errors, so that the trait provides enough support to implement the C++0x std::is_convertible type trait. To get there, the SFINAETrap now knows how to set up a SFINAE context independent of any template instantiations or template argument deduction steps, and (separately) can set a Sema flag to translate access control errors into SFINAE errors. The latter can also be useful if we decide that access control errors during template argument deduction should cause substitution failure (rather than a hard error) as has been proposed for C++0x. llvm-svn: 124446
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/type-traits.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/type-traits.cpp b/clang/test/SemaCXX/type-traits.cpp
index 54d1236dd85..0ecec449637 100644
--- a/clang/test/SemaCXX/type-traits.cpp
+++ b/clang/test/SemaCXX/type-traits.cpp
@@ -502,6 +502,12 @@ struct FromInt { FromInt(int); };
struct ToInt { operator int(); };
typedef void Function();
+void is_convertible_to();
+class PrivateCopy {
+ PrivateCopy(const PrivateCopy&);
+ friend void is_convertible_to();
+};
+
void is_convertible_to() {
int t01[T(__is_convertible_to(Int, Int))];
int t02[F(__is_convertible_to(Int, IntAr))];
@@ -524,4 +530,5 @@ void is_convertible_to() {
int t19[T(__is_convertible_to(IntAr&, const IntAr&))];
int t20[F(__is_convertible_to(const IntAr&, IntAr&))];
int t21[F(__is_convertible_to(Function, Function))];
+ int t22[F(__is_convertible_to(PrivateCopy, PrivateCopy))];
}
OpenPOWER on IntegriCloud