bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Remove MOZ_DELETE macro and use `= delete` directly

RESOLVED FIXED in mozilla37

Status

()

Core
MFBT
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: cpeterson, Assigned: Ehsan)

Tracking

unspecified
mozilla37
All
Windows 8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
Bug 1117820 removed support for MSVC 2012, so we should be able to remove the MOZ_DELETE macro and use `= delete` directly.
(Assignee)

Comment 1

4 years ago
Created attachment 8544872 [details] [diff] [review]
Remove MOZ_DELETE macro and use  directly

Most of this patch (with the exception of mfbt/Attributes.h and
dom/bindings/Codegen.py) was generated by the following bash script:


function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
Attachment #8544872 - Flags: review?(jwalden+bmo)
(Assignee)

Updated

4 years ago
Assignee: nobody → ehsan
I was about to say you should do the same in comm-central, but it turns out there is no use of MOZ_DELETE in comm-central.
>-#include "mozilla/Attributes.h"         // for MOZ_DELETE, MOZ_STACK_CLASS
>+#include "mozilla/Attributes.h"         // for = delete, MOZ_STACK_CLASS

We don't need any header files for |= delete|. Also we could remove the #include from some files.

Comment 4

4 years ago
Comment on attachment 8544872 [details] [diff] [review]
Remove MOZ_DELETE macro and use  directly

Review of attachment 8544872 [details] [diff] [review]:
-----------------------------------------------------------------

Seems like you should land as much of this patch as is trivially doable.  The parts where I have issues, plus the ultimate mfbt/Attributes.h changes, you can mop up in a far-smaller followup patch, since most of these changes are totally independent of each otehr.

::: gfx/layers/basic/BasicLayersImpl.h
@@ +9,5 @@
>  #include "BasicImplData.h"              // for BasicImplData
>  #include "BasicLayers.h"                // for BasicLayerManager
>  #include "ReadbackLayer.h"              // for ReadbackLayer
>  #include "gfxContext.h"                 // for gfxContext, etc
> +#include "mozilla/Attributes.h"         // for = delete, MOZ_STACK_CLASS

Yeah, change this (manually) to just MOZ_STACK_CLASS now.

::: gfx/layers/composite/AsyncCompositionManager.h
@@ +7,5 @@
>  #define GFX_ASYNCCOMPOSITIONMANAGER_H
>  
>  #include "Units.h"                      // for ScreenPoint, etc
>  #include "mozilla/layers/LayerManagerComposite.h"  // for LayerManagerComposite
> +#include "mozilla/Attributes.h"         // for = delete, MOZ_FINAL, etc

And this, in similar fashion.

::: mfbt/Scoped.h
@@ +216,5 @@
>              MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)                        \
>    {}                                                                          \
>  private:                                                                      \
> +  explicit name(name&) = delete;                                            \
> +  name& operator=(name&) = delete;                                          \

These need the \ realigned.

::: mfbt/decimal/Decimal.h
@@ +51,5 @@
>  // To use WTF_MAKE_FAST_ALLOCATED we'd need:
>  // http://src.chromium.org/viewvc/blink/trunk/Source/wtf/FastMalloc.h
>  // Since we don't allocate Decimal objects, no need.
>  #define WTF_MAKE_FAST_ALLOCATED \
> +  void ignore_this_dummy_method() = delete

This requires changes to mfbt/decimal/to-moz-dependencies.h, possibly.  Remove all the mfbt/decimal changes and put them in a followup patch.
Attachment #8544872 - Flags: review?(jwalden+bmo) → review+
(Assignee)

Comment 6

4 years ago
Created attachment 8546390 [details] [diff] [review]
Part 2: Remove MOZ_DELETE macro and use `= delete` directly
Attachment #8546390 - Flags: review?(jwalden+bmo)

Updated

4 years ago
Attachment #8546390 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/a0b1e0b8a80a
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.