Closed
Bug 1748395
Opened 3 years ago
Closed 3 years ago
Use `if constexpr` for expressions that can be determined at compile time
Categories
(Core :: Layout: Text and Fonts, task)
Core
Layout: Text and Fonts
Tracking
()
RESOLVED
FIXED
97 Branch
Tracking | Status | |
---|---|---|
firefox97 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
Details
Attachments
(1 file)
In gfxFont.cpp
and gfxTextRun.cpp
, some template methods have logic that is intended only for 8-bit or 16-bit text such as [1].
if (sizeof(T) == sizeof(char16_t)) {
....
}
This kind of if expression can be determined at the compile time, so it's better to use if constexpr
.
Assignee | ||
Comment 1•3 years ago
|
||
The compiler might already be smart enough to not generate code in an
if-statement that guarantees to be false
at compile time. However it's no harm
to make it explicit by using if constexpr
.
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/01217db0e1fc
Use `if constexpr` for expressions that can be determined at compile time. r=emilio
Comment 3•3 years ago
•
|
||
Backed out changeset 01217db0e1fc (Bug 1748395) for causing build bustages on gfxFont.cpp.
Backout link
Push with failures
Failure Log
Flags: needinfo?(aethanyc)
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/7ee415205518
Use `if constexpr` for expressions that can be determined at compile time. r=emilio
Assignee | ||
Updated•3 years ago
|
Flags: needinfo?(aethanyc)
Comment 5•3 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox97:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•