This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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<typename T>
struct meta {
   static T&& m();   // make
   static void s(T); // sink
};

// operator()(T&,int) available ?
template<typename T, typename = decltype( meta<T&>::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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]