"Definition differs from the declaration in the return type " build failure(s) — clang 3.2

For some reasons, clang refuses the following syntax while g++ accepts it:
#include <streambuf>

struct S { typedef int fd_type; };

template  class A : public std::basic_streambuf, public S
{ fd_type& foo(); };

template  typename A::fd_type& A::foo()
{ return NULL; }
PackageVersionSupposed error messageFull log Bug report
eq10q 1.2-2pstream.h:1820:28: error: out-of-line definition of 'redi::basic_pstreambuf::wpipe' differs from the declaration in the return type Log
pdf2djvu 0.7.12-2pstream.h:1820:28: error: out-of-line definition of 'redi::basic_pstreambuf::wpipe' differs from the declaration in the return type Log

2 errors