[Bug c++/40944] [C++0x] rejects well-formed code: SFINAE, decltype, function call

jwakely dot gcc at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 4 12:51:00 GMT 2009



------- Comment #1 from jwakely dot gcc at gmail dot com  2009-08-04 12:35 -------
I think you're right that this is a bug, this is a slightly reduced testcase
showing the same error:

template<typename T>
struct make { static T&& it(); };

void (*pf)(int&) = 0;

template< typename T >
int bar(T const& x,
        decltype( pf(make<T const&>::it()) )* = 0 // SFINAE!
        ) {
    return 1;
}

int bar(...) {
    return 0;
}

int main() {
    return bar(42);
}

I think this should compile and return 0


-- 

jwakely dot gcc at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwakely dot gcc at gmail dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40944



More information about the Gcc-bugs mailing list