Bug 812531: Make MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE comply with two-phase template name lookup rules, as clang requires, r=khuey, a=blocking-basecamp
authorBrian Smith <bsmith@mozilla.com>
Thu, 15 Nov 2012 17:02:11 -0800
changeset 117335 a1d710de7c6d50c17736760393dff98c7d6db140
parent 117334 7a907d536d1985c2711d54f5ba48bf72c2512a86
child 117336 bcb3abaaa07b00dda4d44dce7f18167fb0e027ce
push id1845
push userbsmith@mozilla.com
push dateThu, 06 Dec 2012 00:49:27 +0000
treeherdermozilla-beta@a1d710de7c6d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, blocking-basecamp
bugs812531
milestone18.0
Bug 812531: Make MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE comply with two-phase template name lookup rules, as clang requires, r=khuey, a=blocking-basecamp
mfbt/Scoped.h
security/manager/ssl/src/ScopedNSSTypes.h
--- a/mfbt/Scoped.h
+++ b/mfbt/Scoped.h
@@ -242,19 +242,21 @@ SCOPED_TEMPLATE(ScopedDeleteArray, Scope
  *                                             PR_Close)
  *   ...
  *   {
  *       ScopedPRFileDesc file(PR_OpenFile(...));
  *       ...
  *   } // file is closed with PR_Close here
  */
 #define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \
-inline void TypeSpecificDelete(Type * value) { Deleter(value); } \
+template <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \
 typedef ::mozilla::TypeSpecificScopedPointer<Type> name;
 
+template <typename T> void TypeSpecificDelete(T * value);
+
 template <typename T>
 struct TypeSpecificScopedPointerTraits
 {
     typedef T* type;
     const static type empty() { return NULL; }
     const static void release(type value)
     {
       if (value)
--- a/security/manager/ssl/src/ScopedNSSTypes.h
+++ b/security/manager/ssl/src/ScopedNSSTypes.h
@@ -68,16 +68,18 @@ MapSECStatus(SECStatus rv)
 {
   if (rv == SECSuccess)
     return NS_OK;
 
   PRErrorCode error = PR_GetError();
   return PRErrorCode_to_nsresult(error);
 }
 
+namespace mozilla {
+
 // Alphabetical order by NSS type
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc,
                                           PRFileDesc,
                                           PR_Close)
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedCERTCertificate,
                                           CERTCertificate,
                                           CERT_DestroyCertificate)
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedCERTCertificateList,