Bug 1316545 part 5 - Make misuseX() concrete such that the AST is computed even if it is unused. r?mystor
MozReview-Commit-ID: 4kkWJjvATzC
--- a/build/clang-plugin/tests/TestCustomHeap.cpp
+++ b/build/clang-plugin/tests/TestCustomHeap.cpp
@@ -16,13 +16,12 @@ void *operator new(size_t x, int qual) M
}
template <typename T>
T *customAlloc() MOZ_HEAP_ALLOCATOR {
T *arg = static_cast<T*>(malloc(sizeof(T)));
return new (arg) T();
}
-template <typename T>
-void misuseX(T q) {
+void misuseX() {
X *foo = customAlloc<X>(); // expected-error {{variable of type 'X' is not valid on the heap}} expected-note {{value incorrectly allocated on the heap}}
X *foo2 = new (100) X(); // expected-error {{variable of type 'X' is not valid on the heap}} expected-note {{value incorrectly allocated on the heap}}
}