diff options
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-expr-1.cpp')
| -rw-r--r-- | clang/test/SemaTemplate/instantiate-expr-1.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-expr-1.cpp b/clang/test/SemaTemplate/instantiate-expr-1.cpp index 4594621103f..37145b63b61 100644 --- a/clang/test/SemaTemplate/instantiate-expr-1.cpp +++ b/clang/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(); } |

