src/glsl.h:2315:29: error: call to non-'constexpr' function 'glsl::vec2& glsl::vec2::operator=(glsl::vec2&&)'
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
People
(Reporter: petr.sumbera, Assigned: lsalzman)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr91+
|
Details | Review |
Steps to reproduce:
Firefox 91.9.0 build fails when GCC 12.1.0 is used. GCC 11 works ok:
[swgl 0.1.0] cargo:warning=src/glsl.h: In constructor 'constexpr glsl::mat2::mat2(glsl::mat2_scalar)':
[swgl 0.1.0] cargo:warning=src/glsl.h:2315:29: error: call to non-'constexpr' function 'glsl::vec2& glsl::vec2::operator=(glsl::vec2&&)'
[swgl 0.1.0] cargo:warning= 2315 | data[0] = vec2(s.data[0]);
[swgl 0.1.0] cargo:warning= | ^
[swgl 0.1.0] cargo:warning=src/glsl.h:469:8: note: 'glsl::vec2& glsl::vec2::operator=(glsl::vec2&&)' is not usable as a 'constexpr' function because:
[swgl 0.1.0] cargo:warning= 469 | struct vec2 {
[swgl 0.1.0] cargo:warning= | ^~~~
[swgl 0.1.0] cargo:warning=In file included from src/glsl.h:7:
[swgl 0.1.0] 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]'
[swgl 0.1.0] cargo:warning= 266 | VectorType& operator=(VectorType x) {
[swgl 0.1.0] cargo:warning= | ^~~~~~~~
[swgl 0.1.0] 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
[swgl 0.1.0] 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]'
[swgl 0.1.0] 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
[swgl 0.1.0] cargo:warning=src/glsl.h: At global scope:
[swgl 0.1.0] cargo:warning=src/glsl.h:2368:46: warning: 'annotate' attribute directive ignored [-Wattributes]
[swgl 0.1.0] cargo:warning= 2368 | IMPLICIT mat3_scalar(const mat4_scalar& mat);
[swgl 0.1.0] cargo:warning= | ^
[swgl 0.1.0] cargo:warning=src/glsl.h:2413:40: warning: 'annotate' attribute directive ignored [-Wattributes]
[swgl 0.1.0] cargo:warning= 2413 | IMPLICIT constexpr mat3(mat3_scalar s) {
[swgl 0.1.0] cargo:warning= | ^
[swgl 0.1.0] cargo:warning=src/glsl.h:2432:32: warning: 'annotate' attribute directive ignored [-Wattributes]
[swgl 0.1.0] cargo:warning= 2432 | IMPLICIT mat3(const mat4& mat);
[swgl 0.1.0] cargo:warning= | ^
[swgl 0.1.0] cargo:warning=src/glsl.h: In constructor 'constexpr glsl::mat3::mat3(glsl::mat3_scalar)':
[swgl 0.1.0] cargo:warning=src/glsl.h:2414:29: error: call to non-'constexpr' function 'glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)'
[swgl 0.1.0] cargo:warning= 2414 | data[0] = vec3(s.data[0]);
[swgl 0.1.0] cargo:warning= | ^
[swgl 0.1.0] cargo:warning=src/glsl.h:1477:8: note: 'glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)' is not usable as a 'constexpr' function because:
[swgl 0.1.0] cargo:warning= 1477 | struct vec3 {
[swgl 0.1.0] cargo:warning= | ^~~~
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Avoid assigning to fields in the constructor body when it is constexpr.
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Comment on attachment 9279367 [details]
Bug 1771932 - Use more initializer lists in glsl.h. r?jrmuizel
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: GCC 12 can't 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.
Comment 5•3 years ago
|
||
Please nominate this for Beta uplift also. 102 is the next ESR so we care about it there too!
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Comment on attachment 9279367 [details]
Bug 1771932 - Use more initializer lists in glsl.h. r?jrmuizel
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration:
- User impact if declined: GCC 12 can't build Firefox.
- Fix Landed on Version:
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky):
Updated•3 years ago
|
Comment 7•3 years ago
|
||
bugherder |
Comment 8•3 years ago
|
||
Comment on attachment 9279367 [details]
Bug 1771932 - Use more initializer lists in glsl.h. r?jrmuizel
Approved for 102 beta 4, thanks.
Comment 9•3 years ago
|
||
bugherder uplift |
Comment 10•3 years ago
|
||
Comment on attachment 9279367 [details]
Bug 1771932 - Use more initializer lists in glsl.h. r?jrmuizel
Approved for 91.11esr.
Comment 11•3 years ago
|
||
bugherder uplift |
Updated•3 years ago
|
Description
•