* [Bug c++/103746] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
@ 2021-12-16 11:14 ` marxin at gcc dot gnu.org
2021-12-16 11:28 ` hubicka at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 11:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-12-16
Status|UNCONFIRMED |WAITING
Ever confirmed|0 |1
CC| |marxin at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
You likely attached a wrong test-case, it's something with
LZ4_decompress_safe_usingDict.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
2021-12-16 11:14 ` [Bug c++/103746] " marxin at gcc dot gnu.org
@ 2021-12-16 11:28 ` hubicka at gcc dot gnu.org
2021-12-16 11:29 ` hubicka at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-12-16 11:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Created attachment 52013
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52013&action=edit
Correct testcase
Oops, uploaded inrrect testcase. This should be current one.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
2021-12-16 11:14 ` [Bug c++/103746] " marxin at gcc dot gnu.org
2021-12-16 11:28 ` hubicka at gcc dot gnu.org
@ 2021-12-16 11:29 ` hubicka at gcc dot gnu.org
2021-12-16 11:31 ` [Bug c++/103746] [12 Regression] " pinskia at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-12-16 11:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|1 |0
Status|WAITING |UNCONFIRMED
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (2 preceding siblings ...)
2021-12-16 11:29 ` hubicka at gcc dot gnu.org
@ 2021-12-16 11:31 ` pinskia at gcc dot gnu.org
2021-12-16 11:33 ` marxin at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16 11:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|GCC 12 rejects code on |[12 Regression] GCC 12
|"call to non-‘constexpr’ |rejects code on "call to
|function ‘glsl::vec3& |non-‘constexpr’ function
|glsl::vec3::operator=(glsl: |‘glsl::vec3&
|:vec3&&)’" while gcc 11 and |glsl::vec3::operator=(glsl:
|clang accepts it |:vec3&&)’" while gcc 11 and
| |clang accepts it
Keywords| |rejects-valid
Target Milestone|--- |12.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (3 preceding siblings ...)
2021-12-16 11:31 ` [Bug c++/103746] [12 Regression] " pinskia at gcc dot gnu.org
@ 2021-12-16 11:33 ` marxin at gcc dot gnu.org
2021-12-16 11:34 ` [Bug c++/103746] [12 Regression] Rejected code "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5 marxin at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 11:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-5256-g37326651b439bac5.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] Rejected code "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (4 preceding siblings ...)
2021-12-16 11:33 ` marxin at gcc dot gnu.org
@ 2021-12-16 11:34 ` marxin at gcc dot gnu.org
2021-12-16 11:40 ` marxin at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 11:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
CC| |jason at gcc dot gnu.org
Summary|[12 Regression] GCC 12 |[12 Regression] Rejected
|rejects code on "call to |code "call to
|non-‘constexpr’ function |non-‘constexpr’ function
|‘glsl::vec3& |‘glsl::vec3&
|glsl::vec3::operator=(glsl: |glsl::vec3::operator=(glsl:
|:vec3&&)’" while gcc 11 and |:vec3&&)’" since
|clang accepts it |r12-5256-g37326651b439bac5
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] Rejected code "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (5 preceding siblings ...)
2021-12-16 11:34 ` [Bug c++/103746] [12 Regression] Rejected code "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5 marxin at gcc dot gnu.org
@ 2021-12-16 11:40 ` marxin at gcc dot gnu.org
2021-12-16 11:41 ` [Bug c++/103746] [12 Regression] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it pinskia at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 11:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:
struct VectorType {
void operator=(VectorType);
};
template <typename> using V4 = VectorType;
using Float = V4<float>;
struct vec3 {
Float x;
};
struct mat3 {
vec3 data[3];
constexpr mat3() { data[2] = vec3(); }
};
$ g++ ff.ii -c
ff.ii: In constructor ‘constexpr mat3::mat3()’:
ff.ii:11:37: error: call to non-‘constexpr’ function ‘vec3&
vec3::operator=(vec3&&)’
11 | constexpr mat3() { data[2] = vec3(); }
| ^
ff.ii:6:8: note: ‘vec3& vec3::operator=(vec3&&)’ is not usable as a ‘constexpr’
function because:
6 | struct vec3 {
| ^~~~
ff.ii:2:8: note: defaulted constructor calls non-‘constexpr’ ‘void
VectorType::operator=(VectorType)’
2 | void operator=(VectorType);
| ^~~~~~~~
ff.ii:2:8: note: ‘void VectorType::operator=(VectorType)’ declared here
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (6 preceding siblings ...)
2021-12-16 11:40 ` marxin at gcc dot gnu.org
@ 2021-12-16 11:41 ` pinskia at gcc dot gnu.org
2021-12-16 11:41 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16 11:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|1 |0
Summary|[12 Regression] Rejected |[12 Regression] GCC 12
|code "call to |rejects code on "call to
|non-‘constexpr’ function |non-‘constexpr’ function
|‘glsl::vec3& |‘glsl::vec3&
|glsl::vec3::operator=(glsl: |glsl::vec3::operator=(glsl:
|:vec3&&)’" since |:vec3&&)’" while gcc 11 and
|r12-5256-g37326651b439bac5 |clang accepts it
Status|NEW |UNCONFIRMED
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This code is definitely not valid but -fimplicit-constexpr will allow it to
compile already.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (7 preceding siblings ...)
2021-12-16 11:41 ` [Bug c++/103746] [12 Regression] GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it pinskia at gcc dot gnu.org
@ 2021-12-16 11:41 ` marxin at gcc dot gnu.org
2021-12-16 11:46 ` [Bug c++/103746] [12 Regression] Rejected code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5 pinskia at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-16 11:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Note Clang and ICC accept the code, while GCC and MSVC reject it.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] Rejected code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (8 preceding siblings ...)
2021-12-16 11:41 ` marxin at gcc dot gnu.org
@ 2021-12-16 11:46 ` pinskia at gcc dot gnu.org
2021-12-16 11:46 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16 11:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
That patch is changing extactly this code. In fact MSVC rejects this code for
the same reason as GCC.
Jason added -fimplicit-constexpr and then found that there was some invalid
code accepted and he fixed that.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] Rejected code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (9 preceding siblings ...)
2021-12-16 11:46 ` [Bug c++/103746] [12 Regression] Rejected code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5 pinskia at gcc dot gnu.org
@ 2021-12-16 11:46 ` pinskia at gcc dot gnu.org
2021-12-16 11:49 ` pinskia at gcc dot gnu.org
2021-12-16 12:54 ` hubicka at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16 11:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
MSVC error:
<source>(12): error C3615: constexpr function 'mat3::mat3' cannot result in a
constant expression
<source>(12): note: failure was caused by call of undefined function or one not
declared 'constexpr'
<source>(12): note: see usage of 'vec3::operator ='
As mentioned -fimplicit-constexpr will workaround the issue really.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] Rejected code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (10 preceding siblings ...)
2021-12-16 11:46 ` pinskia at gcc dot gnu.org
@ 2021-12-16 11:49 ` pinskia at gcc dot gnu.org
2021-12-16 12:54 ` hubicka at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-16 11:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh it is IFNDR (Ill-formed, no diagnostic required) code too :). So accepting
the code is fine so is rejecting it but it is still ill-formed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/103746] [12 Regression] Rejected code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" since r12-5256-g37326651b439bac5
2021-12-16 11:00 [Bug c++/103746] New: GCC 12 rejects code on "call to non-‘constexpr’ function ‘glsl::vec3& glsl::vec3::operator=(glsl::vec3&&)’" while gcc 11 and clang accepts it hubicka at gcc dot gnu.org
` (11 preceding siblings ...)
2021-12-16 11:49 ` pinskia at gcc dot gnu.org
@ 2021-12-16 12:54 ` hubicka at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-12-16 12:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103746
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|INVALID |FIXED
--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I wonder if -fimplicit-constexpr should not be parf of -fpermissive?
That was my attempt to workaround it.
^ permalink raw reply [flat|nested] 14+ messages in thread