Since a sort-of-solution has been suggested in the comments, I'll post it here for future reference; (with additions to make it robust)
typename std::remove_reference<decltype(get_some_string()[0])>::type *restrict a = get_some_string( );
It's horrific. I'll be sticking to typedef
s in these cases, but I can imagine there might be situations where behaviour like this is necessary. With a macro it becomes a bit less terrible:
#define decltype_restrict(x) typename std::remove_reference<decltype((x)[0])>::type *restrict
decltype_restrict(get_some_string()) a = get_some_string( );