Closed Bug 1296742 Opened 4 years ago Closed 4 years ago

clang-cl warning: unintended name hiding in {gfxFont,gfxGDIFont}::GetAdjustedSize

Categories

(Core :: Graphics: Text, defect)

All
Windows
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: froydnj, Assigned: jfkthame)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

clang-cl complains thusly:

 3:36.66 In file included from c:/m-c/gfx/thebes/gfxGDIFont.cpp:6:
 3:36.66 c:/m-c/gfx/thebes/gfxGDIFont.h(31,22):  warning: 'gfxGDIFont::GetAdjustedSize' hides overloaded virtual function [-Woverloaded-virtual]
 3:36.66     virtual gfxFloat GetAdjustedSize()
 3:36.66                      ^
 3:36.66 c:/m-c/gfx/thebes/gfxFont.h(1436,22):  note: hidden overloaded virtual function 'gfxFont::GetAdjustedSize' declared here: different qualifiers (const vs none)
 3:36.66     virtual gfxFloat GetAdjustedSize() const {
 3:36.66                      ^

I guess we need to remove the |const| qualifier and add an |override|?
Component: Graphics → Graphics: Text
Flags: needinfo?(jfkthame)
Whiteboard: [gfx-noted]
One solution here would be to just remove 'const' from gfxFont::GetAdjustedSize, but that turns into a bit of a rabbit-hole as we'd then need to de-constify methods that call it, all the way up the call stacks. I think it's cleaner and simpler to make gfxGDIFont initialize its metrics at construction time, like all our other gfxFont subclasses do, and then we can just get rid of its reimplementation of GetAdjustedSize altogether. (Try build with this and bug 1296740: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9ee69da3198b.)
Attachment #8783553 - Flags: review?(jmuizelaar)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8783553 - Flags: review?(jmuizelaar) → review+
Flags: needinfo?(jfkthame)
https://hg.mozilla.org/integration/mozilla-inbound/rev/e182a8cc0ed9a61cdf3546f2f175916e2d5aa2c4
Bug 1296742 - Initialize gfxGDIFont's metrics at construction time, like other platform font subclasses, and remove its no-longer-needed support for init-on-first-use pattern. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/e182a8cc0ed9
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.