diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-26 00:38:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-26 00:38:10 +0000 |
commit | 1af745143eb3066660d8855c17ccec6b38f5d789 (patch) | |
tree | 38fd90717133ad2a87f681b1d010e2e506baad98 /test/SemaTemplate/instantiate-expr-1.cpp | |
parent | f70823346cd564219902f57df42489c2e6af5f7d (diff) |
Make sure to mark constructors, operator new, and operator delete as
used when we instantiate C++ new expressions, delete expressions, and
object-construction expressions. Fixes PR6424, although we can't test
all of it until we finish implementing lookup of "operator delete" for
new expressions (!).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-1.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-expr-1.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-1.cpp b/test/SemaTemplate/instantiate-expr-1.cpp index 4594621103..37145b63b6 100644 --- a/test/SemaTemplate/instantiate-expr-1.cpp +++ b/test/SemaTemplate/instantiate-expr-1.cpp @@ -152,4 +152,21 @@ namespace PR6424 { }; template void Y<3>::f(); + + template<int I> + struct X2 { + void *operator new(__SIZE_TYPE__) { + int *ip = I; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}} + return ip; + } + }; + + template<int> struct Y2 { + typedef X2<7> X; + void f() { + new X(); // expected-note{{instantiation of}} + } + }; + + template void Y2<3>::f(); } |