[Bug c++/79318] conversion member function preceded with & is not marked as error

2017-02-01 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79318 --- Comment #3 from Jonathan Wakely --- This seems to be http://wg21.link/cwg1726

[Bug c++/79318] conversion member function preceded with & is not marked as error

2017-02-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79318 --- Comment #2 from Jakub Jelinek --- Smaller testcase: struct A { int a; A () : a(0) {}; int () { return a; }; }; int bar () { A a; return a; } clang++ indeed reports: pr79318.C:5:3: error: cannot specify any part of a return type

[Bug c++/79318] conversion member function preceded with & is not marked as error

2017-01-31 Thread gcc at mailinator dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79318 --- Comment #1 from John Simon --- Full example: #include using namespace std; class Foo { private: int a; public: Foo():a(0){}; int() {return a;}; // this fails with Clang }; int main() { Foo foo; int x = foo;