diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-21 17:21:12 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-21 17:21:12 +0000 |
commit | d0c02674e32cea54e386a52094f89abb71b274da (patch) | |
tree | 7f77fdd443e704e17aca6db142c5ec4e4b8c367f /test/SemaTemplate/instantiate-expr-4.cpp | |
parent | 45db71d295cfda888a6187d950bba695ce21a287 (diff) | |
download | clang-d0c02674e32cea54e386a52094f89abb71b274da.tar.gz |
Template instantiation for C++ delete expression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-4.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-expr-4.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-expr-4.cpp b/test/SemaTemplate/instantiate-expr-4.cpp index a6bafc5b2e..2fd9f04569 100644 --- a/test/SemaTemplate/instantiate-expr-4.cpp +++ b/test/SemaTemplate/instantiate-expr-4.cpp @@ -44,7 +44,7 @@ struct Temporaries0 { template struct Temporaries0<5, 7>; // --------------------------------------------------------------------- -// new expressions +// new/delete expressions // --------------------------------------------------------------------- struct Y { }; @@ -83,3 +83,15 @@ struct New2 { template struct New2<X, int, float>; template struct New2<X, int, int*>; // expected-note{{instantiation}} // FIXME: template struct New2<int, int, float>; + +template<typename T> +struct Delete0 { + void f(T t) { + delete t; // expected-error{{cannot delete}} + ::delete [] t; + } +}; + +template struct Delete0<int*>; +template struct Delete0<X*>; +template struct Delete0<int>; // expected-note{{instantiation}} |