summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-function-1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-function-1.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-function-1.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-function-1.cpp b/clang/test/SemaTemplate/instantiate-function-1.cpp
index 3b88700c540..6da25e5984c 100644
--- a/clang/test/SemaTemplate/instantiate-function-1.cpp
+++ b/clang/test/SemaTemplate/instantiate-function-1.cpp
@@ -98,3 +98,17 @@ template<typename T> struct While0 {
};
template struct While0<float>;
+
+template<typename T> struct Do0 {
+ void f(T t) {
+ do {
+ } while (t); // expected-error{{not contextually}}
+
+ do {
+ } while (T t2 = T());
+ }
+};
+
+struct NotConvertibleToBool { };
+template struct Do0<ConvertibleToInt>;
+template struct Do0<NotConvertibleToBool>; // expected-note{{instantiation}}
OpenPOWER on IntegriCloud