Closed Bug 1497330 Opened 11 months ago Closed 11 months ago

TextOverflow.h:48:3: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted]

Categories

(Core :: Web Painting, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox63 --- wontfix
firefox64 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

clang version 8.0.0 (trunk 343613) gives me this warning output for every compilation unit that includes TextOverflow.h:
=========
 0:12.94 ../../../mozilla/layout/generic/TextOverflow.h:48:3: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted]
 0:12.94   TextOverflow() = default;
 0:12.94   ^
 0:12.94 ../../../mozilla/layout/generic/TextOverflow.h:232:26: note: default constructor of 'TextOverflow' is implicitly deleted because field 'mContentArea' has a deleted default constructor
 0:12.94   LogicalRect            mContentArea;
 0:12.94                          ^
 0:12.94 ../../dist/include/mozilla/WritingModes.h:1966:3: note: 'LogicalRect' has been explicitly marked deleted here
 0:12.94   LogicalRect() = delete;
 0:12.94   ^
=========

Basically, TextOverflow has a member-var whose constructor is explicitly deleted -- so TextOverflow's explicitly-default constructor is *actually* deleted, because it doesn't have any way to construct that member.

So we should just make its explicitly-defaulted constructor be explicitly deleted instead, to reflect reality and address the build warning.
Before this patch, TextOverflow had an explicitly-*defaulted* default
constructor. But in fact, this constructor was *implicitly* deleted because one
of the member variables (of type LogicalRect) couldn't be default-constructed
due to having its own default constructor explicitly deleted.

clang trunk highlights this inconsistency with a build warning
(-Wdefaulted-function-deleted) which this patch addresses.
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/255753135a7f
Explicitly delete TextOverflow's default constructor. r=dthayer
https://hg.mozilla.org/mozilla-central/rev/255753135a7f
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.