https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #19 from Jonathan Wakely ---
I still think this is just invalid, for the reasons given in comment 5.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #17 from Andrew Pinski ---
Note the original didn't:
```
auto b = range_.begin();
bool result = (b != range_.end());
begin_ = std::move(b);
return result;
```
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #16 from Andrew Pinski ---
The reduced testcase has an uninitialized variable in it:
```
if (!begin_.has_value()) {
bool result;
return result;
}
```
This might be the issue overall.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #18 from Andrew Pinski ---
For the reduced testcase:
```
: In member function 'auto Intersections()::Enumerator::Next()':
:65:16: warning: 'result' may be used uninitialized
[-Wmaybe-uninitialized]
65 | return result;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #15 from mcccs at gmx dot com ---
Thanks Jonathan for -x c++, it was just what GCC on my system needed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #14 from mcccs at gmx dot com ---
Created attachment 61179
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61179&action=edit
reduced.cpp
I think this reduction is valid. Fails with -O1 -fcode-hoisting, doesn't fail
with -O0 or -
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #13 from Jonathan Wakely ---
Ah but the filename x.cpp does imply C++.
Still, the commands work for me (with just a -Wnon-template-friend warning).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #12 from Jonathan Wakely ---
You need -x c++ for the first command, otherwise the preprocessor runs as C and
will not have any C++ macros (like --cplusplus) defined.
g++ -E does *not* imply C++
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
mcccs at gmx dot com changed:
What|Removed |Added
CC||mcccs at gmx dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #10 from Raffael Casagrande ---
(In reply to Jonathan Wakely from comment #9)
Thanks very much! I missed the part with the trivial copy constructor and
learned again an important lesson. That explains why it works when I defined
the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #9 from Jonathan Wakely ---
Ironically, writing a user-provided (and so non-trivial) copy constructor which
fixes up the self-referential pointer (or iterator, in your case) will restore
guaranteed elision, and that copy constructor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #8 from Jonathan Wakely ---
I explained this in PR 109945 comment 25
There is no guaranteed copy elision for objects with a trivial copy constructor
and trivial (or deleted) destructor. The compiler is allowed to make temporary
copi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #7 from Raffael Casagrande ---
@Jonathan Wakely Thanks very much for the detailed analysis. But there is one
point which I don't understand:
> BUT, the self-referential pointer is set to the address of the range_ member
> before th
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #6 from Richard Biener ---
Thanks, so keeping this open but it will likely end up INVALID.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #5 from Jonathan Wakely ---
return EnumeratorRange(Enumerator(std::views::single(Intersection(;
This creates a temporary Intersection object, then copies that into a
single_view object. Then that is copied into an Enumerator o
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
Richard Biener changed:
What|Removed |Added
CC||redi at gcc dot gnu.org
--- Comment #4
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
Richard Biener changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
Richard Biener changed:
What|Removed |Added
CC||jamborm at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
Richard Biener changed:
What|Removed |Added
CC||rguenth at gcc dot gnu.org
Last reco
19 matches
Mail list logo