[Bug c++/39050] New: [c++0x] rvalue reference & copy construction issue
Consider: struct S { private: S(const S&); // no copy-c'tor }; S && ref(); void f(S); void g() { f(ref()); } This compiles using g++ -c -std=c++0x test.cpp where in fact the compiler should complain about the copy-c'tor not being public. -- Summary: [c++0x] rvalue reference & copy construction issue Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: s dot gesemann at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39050
[Bug c++/40944] New: [C++0x] rejects well-formed code: SFINAE, decltype, function call
I think the following code is well-formed and should compile with the -std=c++0x switch: #include template struct make { static T&& it(); }; template struct exists { typedef R type; }; template< typename Func, typename T > void bar(T const& x, typename exists< int, decltype( make::it()(make::it()) ) // SFINAE! >::type = 0 ) { std::cout << "bar-1\n"; } template< typename Func > void bar(...) { std::cout << "bar-2\n"; } int main() { bar(42); } I expect it to compile and print "bar-2". Instead, the compiler rejects the code with the error invalid initialization of reference >int&< with an expression of type >const int<. Cheers! SG -- Summary: [C++0x] rejects well-formed code: SFINAE, decltype, function call Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: s dot gesemann at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40944
[Bug c++/39050] [c++0x] rvalue reference & copy construction issue
--- Comment #1 from s dot gesemann at gmail dot com 2009-02-02 15:18 --- This is probably just another manifestation of the same bug (#36744) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36744 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39050
[Bug c++/40944] [C++0x] rejects well-formed code: SFINAE, decltype, function call
--- Comment #2 from s dot gesemann at gmail dot com 2009-08-16 12:48 --- This is probably a related (SFINAE<->decltype) problem: template struct meta { static T&& m(); // make static void s(T); // sink }; // operator()(T&,int) available ? template::m()(23) )> int foo(T x) { x(23); return 1; } int foo(...) { return 0; } int main() { return foo(42); } As far as I can tell it should compile with -std=c++0x and return 0. Instead, the compiler rejects the code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40944
[Bug c++/40944] [C++0x] rejects well-formed code: SFINAE, decltype, function call
--- Comment #3 from s dot gesemann at gmail dot com 2009-08-16 13:00 --- sorry, please disregard my previous comment. I accidentally used GCC 4.3.3 instead of GCC 4.4.1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40944