[Bug c++/69436] Method returning "auto&" fails to resolve "*this" (-std=c++17)

2016-01-27 Thread vmorgulys at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69436

--- Comment #6 from vmorgulys at gmail dot com ---
Hello Jonathan,

I have another similar issue with auto and deleted contructrors
("=delete"). They are not detected at compile time.

Do you think it is related to what you mention in your comment (Concept TS)?

If I understand correctly, I need to build gcc with the trunk version to be
sure. Is it correct?

Thank you a lot for your work on gcc.

Cheers,

Marc

2016-01-22 22:03 GMT+01:00 redi at gcc dot gnu.org :

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69436
>
> --- Comment #2 from Jonathan Wakely  ---
> (In reply to vmorgulys from comment #0)
> >  auto& f2(auto v)
>
> This is not standard C++, it's part of the Concepts TS, and so doesn't work
> properly until GCC 6.
>
> --
> You are receiving this mail because:
> You reported the bug.
>

[Bug c++/69436] Method returning "auto&" fails to resolve "*this" (-std=c++17)

2016-01-23 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69436

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #5 from Jonathan Wakely  ---
Yes, this is another dup.

Please report a new bug for outstanding bugs on trunk.

*** This bug has been marked as a duplicate of bug 64969 ***

[Bug c++/69436] Method returning "auto&" fails to resolve "*this" (-std=c++17)

2016-01-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69436

--- Comment #2 from Jonathan Wakely  ---
(In reply to vmorgulys from comment #0)
>  auto& f2(auto v)

This is not standard C++, it's part of the Concepts TS, and so doesn't work
properly until GCC 6.

[Bug c++/69436] Method returning "auto&" fails to resolve "*this" (-std=c++17)

2016-01-22 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69436

--- Comment #1 from Andrew Pinski  ---
I think the problem is the two auto are considered the same.  I don't know the
C++ standard in these places to say if GCC should reject or accept it so I
cannot comment on that.

[Bug c++/69436] Method returning "auto&" fails to resolve "*this" (-std=c++17)

2016-01-22 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69436

--- Comment #4 from TC  ---
Although this still breaks on trunk GCC on Wandbox:

long x;
auto& f(auto) { return x; }
auto* g(auto) { return  }
auto r = f(1);
auto p = g(1);

prog.cc: In instantiation of 'auto& f(auto:1) [with auto:1 = int]':
prog.cc:4:13:   required from here
prog.cc:2:24: error: invalid initialization of non-const reference of type
'int&' from an rvalue of type 'int'
 auto& f(auto) { return x; }
^

prog.cc: In instantiation of 'auto* g(auto:2) [with auto:2 = int]':
prog.cc:5:13:   required from here
prog.cc:3:25: error: cannot convert 'long int*' to 'int*' in return
 auto* g(auto) { return  }
 ^

I guess PR64969's fix only handled functions returning 'auto', and not
something more complicated.

[Bug c++/69436] Method returning "auto&" fails to resolve "*this" (-std=c++17)

2016-01-22 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69436

TC  changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #3 from TC  ---
Another manifestation of PR64969 and friends?