diff options
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-function-1.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-function-1.cpp | 14 |
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}} |