http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54336
Bug #: 54336
Summary: [c++0x] diagnostics for functions with arg-dependent
return types have bad signatures
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
This code:
template<typename T> auto func(T x) -> decltype(x.method())
{
static_assert(false, "test");
}
fails to compile with:
decltype_return.cc: In function 'decltype (x.method()) func(T)':
decltype_return.cc:3:3: error: static assertion failed: test
static_assert(false, "test");
^
What's 'decltype (x.method()) func(T)'? x isn't defined. 'auto func(T x) ->
decltype(x.method())' or even 'decltype (x.method()) func (T x)' would be
better.