summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/NewDelete-variadic.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-02-04 01:14:30 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-02-04 01:14:30 +0000
commitbdd146435ff77f63c83823eeec4d763c6fb9a2d8 (patch)
treed61a74713f68cd0623c1ea8e690bc79f74c0e800 /clang/test/Analysis/NewDelete-variadic.cpp
parent7437589fa186d1f0e58d7528bf9b7351fae5ffdc (diff)
downloadbcm5719-llvm-bdd146435ff77f63c83823eeec4d763c6fb9a2d8.tar.gz
bcm5719-llvm-bdd146435ff77f63c83823eeec4d763c6fb9a2d8.zip
Add implicit declarations of allocation functions when looking them up for
redeclaration, not just when looking them up for a use -- we need the implicit declaration to appropriately check various properties of them (notably, whether they're deleted). llvm-svn: 200729
Diffstat (limited to 'clang/test/Analysis/NewDelete-variadic.cpp')
-rw-r--r--clang/test/Analysis/NewDelete-variadic.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/clang/test/Analysis/NewDelete-variadic.cpp b/clang/test/Analysis/NewDelete-variadic.cpp
index 53dba463bbf..62a7d17e1b2 100644
--- a/clang/test/Analysis/NewDelete-variadic.cpp
+++ b/clang/test/Analysis/NewDelete-variadic.cpp
@@ -5,15 +5,19 @@ namespace std {
typedef __typeof__(sizeof(int)) size_t;
}
-void *operator new(std::size_t, ...);
-void *operator new[](std::size_t, ...);
+struct X {};
+
+void *operator new(std::size_t, X, ...);
+void *operator new[](std::size_t, X, ...);
void testGlobalCustomVariadicNew() {
- void *p1 = operator new(0); // no warn
+ X x;
+
+ void *p1 = operator new(0, x); // no warn
- void *p2 = operator new[](0); // no warn
+ void *p2 = operator new[](0, x); // no warn
- int *p3 = new int; // no warn
+ int *p3 = new (x) int; // no warn
- int *p4 = new int[0]; // no warn
+ int *p4 = new (x) int[0]; // no warn
}
OpenPOWER on IntegriCloud