Bug 1282795 - Forward-declare a bunch of TracerConcrete<T>::concreteTypeName[] so that the default virtual TracerConcrete<T>::typeName() can refer to those declarations before their definitions, without triggering compiler warnings up the wazoo. r=froydnj
☠☠ backed out by bb8e5533b829 ☠ ☠
authorJeff Walden <jwalden@mit.edu>
Tue, 28 Jun 2016 17:06:56 +0100
changeset 303073 763642feedb0674298786511e0d8a4d0b67858d6
parent 303072 7b95036211d484cf6270b81c7fb18aa583470e7c
child 303074 2733f167b8cd6f5c2ce2713f08ebb5e2511a77df
push id30379
push usercbook@mozilla.com
push dateWed, 29 Jun 2016 14:13:35 +0000
treeherdermozilla-central@b69a5bbb5e40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1282795
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1282795 - Forward-declare a bunch of TracerConcrete<T>::concreteTypeName[] so that the default virtual TracerConcrete<T>::typeName() can refer to those declarations before their definitions, without triggering compiler warnings up the wazoo. r=froydnj
js/public/UbiNode.h
--- a/js/public/UbiNode.h
+++ b/js/public/UbiNode.h
@@ -1019,16 +1019,33 @@ class TracerConcrete : public Base {
     explicit TracerConcrete(Referent* ptr) : Base(ptr) { }
     Referent& get() const { return *static_cast<Referent*>(ptr); }
 
   public:
     static const char16_t concreteTypeName[];
     static void construct(void* storage, Referent* ptr) { new (storage) TracerConcrete(ptr); }
 };
 
+// Forward declarations, to silence compiler warnings.
+
+// Defined in js/src/vm/UbiNode.cpp.
+template<> const char16_t TracerConcrete<JS::Symbol>::concreteTypeName[];
+template<> const char16_t TracerConcrete<JSScript>::concreteTypeName[];
+template<> const char16_t TracerConcrete<js::LazyScript>::concreteTypeName[];
+template<> const char16_t TracerConcrete<js::jit::JitCode>::concreteTypeName[];
+template<> const char16_t TracerConcrete<js::Shape>::concreteTypeName[];
+template<> const char16_t TracerConcrete<js::BaseShape>::concreteTypeName[];
+template<> const char16_t TracerConcrete<js::ObjectGroup>::concreteTypeName[];
+
+// Defined in js/src/vm/String.cpp.
+template<> const char16_t TracerConcrete<JSString>::concreteTypeName[];
+
+// Defined in js/src/jsobj.cpp.
+template<> const char16_t TracerConcrete<JSObject>::concreteTypeName[];
+
 // For JS::TraceChildren-based types that have a 'compartment' method.
 template<typename Referent>
 class TracerConcreteWithCompartment : public TracerConcrete<Referent> {
     typedef TracerConcrete<Referent> TracerBase;
     JSCompartment* compartment() const override;
 
   protected:
     explicit TracerConcreteWithCompartment(Referent* ptr) : TracerBase(ptr) { }