Closed Bug 1497330 Opened 2 years ago Closed 2 years ago
Overflow .h:48:3: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted]
46 bytes, text/x-phabricator-request
|Details | Review|
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 email@example.com: https://hg.mozilla.org/integration/autoland/rev/255753135a7f Explicitly delete TextOverflow's default constructor. r=dthayer
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.