[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 --- Comment #10 from Andrew Pinski --- (In reply to Jonathan Wakely from comment #6) > The problem is that ctx._M_indent is a member access expression through a > reference, which is not allowed in constant expressions. This is a silly > restric

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 Jonathan Wakely changed: What|Removed |Added Target Milestone|--- |12.0 Resolution|---

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 --- Comment #8 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:6c25932ac399423b09b730fb8f894ada568deb2a commit r12-2933-g6c25932ac399423b09b730fb8f894ada568deb2a Author: Jonathan Wakely Date:

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 --- Comment #7 from cqwrteur --- (In reply to Jakub Jelinek from comment #5) > Do we need to work around clang bugs here though? In headers I can > understand it, but this is in the libstdc++.{so,a} only code. well i love gcc, however, unfortu

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 Jonathan Wakely changed: What|Removed |Added Last reconfirmed||2021-08-16 Assignee|unassig

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 --- Comment #5 from Jakub Jelinek --- Do we need to work around clang bugs here though? In headers I can understand it, but this is in the libstdc++.{so,a} only code.

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 --- Comment #4 from Jonathan Wakely --- Clang accepts this: struct S { enum { _M_indent = 4 }; }; int f(S s) { const char str[s._M_indent + 1] = ""; return sizeof(str); } But rejects the same program with a reference parameter: str

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 --- Comment #3 from Jonathan Wakely --- It's not a VLA though, _M_indent is an enumerator with the value 4, and ctx._M_index + 1 is 5.

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #2

[Bug libstdc++/101937] error: variable-sized object may not be initialized

2021-08-16 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101937 --- Comment #1 from Richard Biener --- but it's 'const' so it must be initialized?