Bug 765381 - Make the destructors on nsHtml5ElementName and nsHtml5AttributeName virtual to avoid warnings in clang. r=ehsan
authorHenri Sivonen <hsivonen@iki.fi>
Fri, 13 Jul 2012 15:04:11 +0300
changeset 104018 5c7fd2550d3c9e930c4e7b487987dfcd542ae5e7
parent 104017 06756c4481d5dda73afdb1634bdde1b3ae681ac5
child 104019 eab366e56bf1b7579479b0df902bd7e8d78de04e
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs765381
milestone16.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 765381 - Make the destructors on nsHtml5ElementName and nsHtml5AttributeName virtual to avoid warnings in clang. r=ehsan
parser/html/javasrc/AttributeName.java
parser/html/javasrc/ElementName.java
parser/html/nsHtml5AttributeName.h
parser/html/nsHtml5ElementName.h
--- a/parser/html/javasrc/AttributeName.java
+++ b/parser/html/javasrc/AttributeName.java
@@ -437,17 +437,17 @@ public final class AttributeName
     @Virtual void release() {
         // No-op in Java.
         // Implement as |delete this;| in subclass.
     }
 
     /**
      * The C++ destructor.
      */
-    @SuppressWarnings("unused") private void destructor() {
+    @SuppressWarnings("unused") @Virtual private void destructor() {
         Portability.deleteArray(local);
     }
 
     /**
      * Clones the attribute using an interner. Returns <code>this</code> in Java
      * and for non-dynamic instances in C++.
      * 
      * @param interner
--- a/parser/html/javasrc/ElementName.java
+++ b/parser/html/javasrc/ElementName.java
@@ -162,17 +162,17 @@ public final class ElementName
     }
     
     @Virtual void release() {
         // No-op in Java. 
         // Implement as delete this in subclass.
         // Be sure to release the local name
     }
     
-    @SuppressWarnings("unused") private void destructor() {
+    @SuppressWarnings("unused") @Virtual private void destructor() {
     }
 
     @Virtual public ElementName cloneElementName(Interner interner) {
         return this;
     }
     
     // START CODE ONLY USED FOR GENERATING CODE uncomment and run to regenerate
 
--- a/parser/html/nsHtml5AttributeName.h
+++ b/parser/html/nsHtml5AttributeName.h
@@ -81,17 +81,17 @@ class nsHtml5AttributeName
     nsIAtom** local;
     nsIAtom** prefix;
   protected:
     nsHtml5AttributeName(PRInt32* uri, nsIAtom** local, nsIAtom** prefix);
   private:
     static nsHtml5AttributeName* createAttributeName(nsIAtom* name);
   public:
     virtual void release();
-    ~nsHtml5AttributeName();
+    virtual ~nsHtml5AttributeName();
     virtual nsHtml5AttributeName* cloneAttributeName(nsHtml5AtomTable* interner);
     PRInt32 getUri(PRInt32 mode);
     nsIAtom* getLocal(PRInt32 mode);
     nsIAtom* getPrefix(PRInt32 mode);
     bool equalsAnother(nsHtml5AttributeName* another);
     static nsHtml5AttributeName* ATTR_D;
     static nsHtml5AttributeName* ATTR_K;
     static nsHtml5AttributeName* ATTR_R;
--- a/parser/html/nsHtml5ElementName.h
+++ b/parser/html/nsHtml5ElementName.h
@@ -71,17 +71,17 @@ class nsHtml5ElementName
     static nsHtml5ElementName* elementNameByBuffer(PRUnichar* buf, PRInt32 offset, PRInt32 length, nsHtml5AtomTable* interner);
   private:
     static PRInt32 bufToHash(PRUnichar* buf, PRInt32 len);
     nsHtml5ElementName(nsIAtom* name, nsIAtom* camelCaseName, PRInt32 flags);
   protected:
     nsHtml5ElementName(nsIAtom* name);
   public:
     virtual void release();
-    ~nsHtml5ElementName();
+    virtual ~nsHtml5ElementName();
     virtual nsHtml5ElementName* cloneElementName(nsHtml5AtomTable* interner);
     static nsHtml5ElementName* ELT_A;
     static nsHtml5ElementName* ELT_B;
     static nsHtml5ElementName* ELT_G;
     static nsHtml5ElementName* ELT_I;
     static nsHtml5ElementName* ELT_P;
     static nsHtml5ElementName* ELT_Q;
     static nsHtml5ElementName* ELT_S;