diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-15 21:56:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-15 21:56:04 +0000 |
commit | 9f3ca2a7747bd47f14d7693f333103fac29a24d2 (patch) | |
tree | 8ba11394ed186fda639bea1f3f03482c94e86b99 /test/SemaTemplate/instantiate-function-1.cpp | |
parent | 463b87687346d3990a9854382abfb41810f0678a (diff) | |
download | clang-9f3ca2a7747bd47f14d7693f333103fac29a24d2.tar.gz |
Template instantiation for do-while statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-function-1.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-function-1.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-function-1.cpp b/test/SemaTemplate/instantiate-function-1.cpp index 3b88700c54..6da25e5984 100644 --- a/test/SemaTemplate/instantiate-function-1.cpp +++ b/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}} |