[Bug c++/109529] the r-value volatile object is not accepted by the l-value volatile constant argument.

2023-04-16 Thread lisp2d at rambler dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109529 --- Comment #7 from Lisp2D --- .. or int volatile && rx = static_cast < int volatile && > ( x ) ; fun(rx);

[Bug c++/109529] the r-value volatile object is not accepted by the l-value volatile constant argument.

2023-04-16 Thread lisp2d at rambler dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109529 --- Comment #6 from Lisp2D --- (In reply to Andrew Pinski from comment #4) > https://stackoverflow.com/questions/40193008/why-a-const-volatile-reference- stackoverflow offers to link an rvalue reference to a variable for this. But I think this

[Bug c++/109529] the r-value volatile object is not accepted by the l-value volatile constant argument.

2023-04-16 Thread lisp2d at rambler dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109529 --- Comment #3 from Lisp2D --- (In reply to Andrew Pinski from comment #2) > Since `static_cast(x)` is considered rvalue and `int I can't find a reason anywhere in the standard why the volatile property prevents conversion from `&&` to `const &`

[Bug c++/109529] New: the r-value volatile object is not accepted by the l-value volatile constant argument.

2023-04-15 Thread lisp2d at rambler dot ru via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lisp2d at rambler dot ru Target Milestone: --- void funy(int const &){} void fun(int volatile const &){} int main(){ int y ; funy(y); // goo

[Bug c++/107132] New: a temporary object with an x-value is not destroyed and is bound to a variable

2022-10-03 Thread lisp2d at rambler dot ru via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: lisp2d at rambler dot ru Target Milestone: --- a temporary object with an x-value is not destroyed and is bound to a variable the question is taken from a social

[Bug c++/81597] returns link to temporary value

2017-07-28 Thread lisp2d at rambler dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81597 --- Comment #4 from Lisp2D --- -Werror=return-local-addr it is all i want thnx

[Bug c++/81597] returns link to temporary value

2017-07-28 Thread lisp2d at rambler dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81597 --- Comment #2 from Lisp2D --- Make an error (don't compile) when returns rvalue from these functions. To forbid or banning.

[Bug c++/81597] New: returns link to temporary value

2017-07-28 Thread lisp2d at rambler dot ru
++ Assignee: unassigned at gcc dot gnu.org Reporter: lisp2d at rambler dot ru Target Milestone: --- Functions returning C && , C const && , C const & from temporary object will ALWAYS with wrong result. Warning is good but ... To do : prevent return rvalue from those