Bug 1316545 part 5 - Make misuseX() concrete such that the AST is computed even if it is unused. r?mystor draft
authorTing-Yu Chou <janus926@gmail.com>
Thu, 24 Nov 2016 11:48:33 +0800
changeset 446209 2d4124215f20688dcb6c20e6a4f70d13bd5d6fed
parent 446208 7aa2606deb257afa18ce0f54fea15325cf36c157
child 446210 eadedc55e2241d602597cd71d4e9f0e1ab011e02
push id37726
push userbmo:janus926@gmail.com
push dateThu, 01 Dec 2016 03:26:49 +0000
reviewersmystor
bugs1316545
milestone53.0a1
Bug 1316545 part 5 - Make misuseX() concrete such that the AST is computed even if it is unused. r?mystor MozReview-Commit-ID: 4kkWJjvATzC
build/clang-plugin/tests/TestCustomHeap.cpp
--- 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}}
 }