[GCC12] error: call to non-‘constexpr’ function
Categories
(Firefox Build System :: General, defect, P3)
Tracking
(firefox-esr91 fixed, firefox99 fixed)
People
(Reporter: stransky, Assigned: stransky)
References
Details
Attachments
(3 files)
Firefox fails to build with gcc 12 (Fedora 36):
0:38.65 /home/komat/src/mozilla-unified/objdir-opt/dist/include/mozilla/TimingParams.h: In constructor ‘constexpr mozilla::TimingParams::TimingParams(const mozilla::TimeDuration&, const mozilla::TimeDuration&, const mozilla::TimeDuration&, float, float, mozilla::dom::PlaybackDirection, mozilla::dom::FillMode, mozilla::Maybe<mozilla::ComputedTimingFunction>&&)’:
0:38.65 /home/komat/src/mozilla-unified/objdir-opt/dist/include/mozilla/TimingParams.h:58:11: error: call to non-‘constexpr’ function ‘void mozilla::TimingParams::Update()’
0:38.65 58 | Update();
0:38.65 | ~~~~~~^~
0:38.65 /home/komat/src/mozilla-unified/objdir-opt/dist/include/mozilla/TimingParams.h:209:8: note: ‘void mozilla::TimingParams::Update()’ declared here
0:38.65 209 | void Update() {
0:38.65 | ^~~~~~
| Assignee | ||
Comment 1•4 years ago
•
|
||
0:37.20 /home/komat/src/mozilla-unified/objdir-opt/dist/include/mozilla/TimingParams.h:38:59: error: call to non-‘constexpr’ function ‘static mozilla::BaseTimeDuration<ValueCalculator> mozilla::BaseTimeDuration<ValueCalculator>::FromMilliseconds(double) [with ValueCalculator = mozilla::StickyTimeDurationValueCalculator]’
0:37.20 38 | mDuration.emplace(StickyTimeDuration::FromMilliseconds(aDuration));
| Assignee | ||
Comment 2•4 years ago
•
|
||
And there's another constexpr bug:
0:17.18 cargo:warning=src/glsl.h: In constructor ‘constexpr glsl::mat3::mat3(glsl::mat3_scalar)’:
0:17.18 cargo:warning=src/glsl.h:2414:29: error: call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’
0:17.18 cargo:warning= 2414 | data[0] = vec3(s.data[0]);
0:17.18 cargo:warning= | ^
0:17.18 cargo:warning=src/glsl.h:1477:8: note: ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’ is not usable as a ‘constexpr’ function because:
0:17.18 cargo:warning= 1477 | struct vec3 {
0:17.18 cargo:warning= | ^~~~
0:17.18 cargo:warning=src/vector_type.h:266:15: note: defaulted constructor calls non-‘constexpr’ ‘glsl::VectorType<T, N>& glsl::VectorType<T, N>::operator=(glsl::VectorType<T, N>) [with T = float; int N = 4]’
0:17.18 cargo:warning= 266 | VectorType& operator=(VectorType x) {
0:17.18 cargo:warning= | ^~~~~~~~
0:17.18 cargo:warning=src/vector_type.h:266:15: note: ‘glsl::VectorType<T, N>& glsl::VectorType<T, N>::operator=(glsl::VectorType<T, N>) [with T = float; int N = 4]’ declared here
0:17.18 cargo:warning=src/vector_type.h:266:15: note: defaulted constructor calls non-‘constexpr’ ‘glsl::VectorType<T, N>& glsl::VectorType<T, N>::operator=(glsl::VectorType<T, N>) [with T = float; int N = 4]’
0:17.18 cargo:warning=src/vector_type.h:266:15: note: ‘glsl::VectorType<T, N>& glsl::VectorType<T, N>::operator=(glsl::VectorType<T, N>) [with T = float; int N = 4]’ declared here
0:17.18 cargo:warning=src/vector_type.h:266:15: note: defaulted constructor calls non-‘constexpr’ ‘glsl::VectorType<T, N>& glsl::VectorType<T, N>::operator=(glsl::VectorType<T, N>) [with T = float; int N = 4]’
0:17.18 cargo:warning=src/vector_type.h:266:15: note: ‘glsl::VectorType<T, N>& glsl::VectorType<T, N>::operator=(glsl::VectorType<T, N>) [with T = float; int N = 4]’ declared here
0:17.18 cargo:warning=src/glsl.h: In constructor ‘constexpr glsl::mat3::mat3(glsl::mat3_scalar, glsl::mat3_scalar, glsl::mat3_scalar, glsl::mat3_scalar)’:
0:17.18 cargo:warning=src/glsl.h:2420:66: error: call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’
0:17.18 cargo:warning= 2420 | data[0] = vec3(s0.data[0], s1.data[0], s2.data[0], s3.data[0]);
0:17.18 cargo:warning= | ^
0:17.19 cargo:warning=src/glsl.h: In constructor ‘constexpr glsl::mat3::mat3(glsl::Float, glsl::Float, glsl::Float, glsl::Float, glsl::Float, glsl::Float, glsl::Float, glsl::Float, glsl::Float)’:
0:17.19 cargo:warning=src/glsl.h:2427:30: error: call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’
0:17.19 cargo:warning= 2427 | data[0] = vec3(d1, d2, d3);
0:17.19 cargo:warning= | ^
0:17.19 cargo:warning=src/glsl.h: At global scope:
0:17.19 cargo:warning=src/glsl.h:2600:40: warning: ‘annotate’ attribute directive ignored [-Wattributes]
0:17.19 cargo:warning= 2600 | IMPLICIT constexpr mat4(mat4_scalar s) {
0:17.19 cargo:warning= | ^
0:17.19 cargo:warning=src/glsl.h: In constructor ‘constexpr glsl::mat4::mat4(glsl::mat4_scalar)’:
0:17.19 cargo:warning=src/glsl.h:2601:29: error: call to non-‘constexpr’ function ‘glsl::vec4& glsl::vec4::operator=(glsl::vec4&&)’
0:17.19 cargo:warning= 2601 | data[0] = vec4(s.data[0]);
| Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Those seem like legit bugs? ni? boris for the ActiveParams issue (was introduced in bug 1676791).
| Assignee | ||
Comment 4•4 years ago
|
||
Updated•4 years ago
|
| Assignee | ||
Comment 5•4 years ago
|
||
Emilio, any hint how to fix the cargo:warning=src/glsl.h ? I guess that's some c/rust binding or so? I have zero experience with that.
Thanks.
Comment 6•4 years ago
|
||
We call it from another constexpr function. Clang seems to not be so
strict about this.
Comment 7•4 years ago
|
||
it's a regular C++ build of swgl, but it's driven by a rust build script. Anyways ^ fixes it.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 8•4 years ago
|
||
| Assignee | ||
Comment 9•4 years ago
|
||
Cool, Thanks a lot!
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/4787f2d8a873
https://hg.mozilla.org/mozilla-central/rev/8af9ccb50f19
Comment 14•4 years ago
|
||
| bugherder | ||
Comment 15•3 years ago
|
||
Comment on attachment 9264479 [details]
Bug 1754752 - Use initializer lists in some swgl constructors. r=lsalzman,#gfx-reviewers
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: ESR 91 fails to build with GCC 12.
- User impact if declined: Users with GCC 12 are unable to build Firefox.
- Fix Landed on Version:
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Doesn't change any semantics, so no risk.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 16•3 years ago
|
||
Comment on attachment 9264479 [details]
Bug 1754752 - Use initializer lists in some swgl constructors. r=lsalzman,#gfx-reviewers
Approved for 91.11esr.
Comment 17•3 years ago
|
||
| bugherder uplift | ||
Description
•