diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-26 05:06:18 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-26 05:06:18 +0000 |
commit | 6642ca217e730060530ad679bf395ee0e208f188 (patch) | |
tree | b427cac52028757fb8890ef856c1045e9847912a /clang/test/CXX/expr/expr.unary/expr.new/p20-0x.cpp | |
parent | 044ada532c5419c7b8379b7e7b25815ab10e997e (diff) | |
download | bcm5719-llvm-6642ca217e730060530ad679bf395ee0e208f188.tar.gz bcm5719-llvm-6642ca217e730060530ad679bf395ee0e208f188.zip |
Implement semantic analysis for C++ [expr.new]p18-20, which describe
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.
This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.
llvm-svn: 97209
Diffstat (limited to 'clang/test/CXX/expr/expr.unary/expr.new/p20-0x.cpp')
-rw-r--r-- | clang/test/CXX/expr/expr.unary/expr.new/p20-0x.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.unary/expr.new/p20-0x.cpp b/clang/test/CXX/expr/expr.unary/expr.new/p20-0x.cpp new file mode 100644 index 00000000000..c188e1e25e0 --- /dev/null +++ b/clang/test/CXX/expr/expr.unary/expr.new/p20-0x.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s +typedef __SIZE_TYPE__ size_t; + +struct S { + // Placement allocation function: + static void* operator new(size_t, size_t); + // Usual (non-placement) deallocation function: + static void operator delete(void*, size_t); // expected-note{{declared here}} +}; + +void testS() { + S* p = new (0) S; // expected-error{{'new' expression with placement arguments refers to non-placement 'operator delete'}} +} |