Bug 1316545 part 5 - Make misuseX() concrete such that the AST is computed even if it is unused. r=mystor
authorTing-Yu Chou <janus926@gmail.com>
Thu, 24 Nov 2016 11:48:33 +0800
changeset 325125 8a86e67f78c60c44a4ce2aac416e8835a76351a4
parent 325124 46bc9b15800185d4d814a95ae379cf069740f01a
child 325126 ad869ab08f361410311b75b33347035733ba93a3
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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}}
 }