https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61400
Bug ID: 61400 Summary: suffix return type doesn't work for member functions Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: yyc1992 at gmail dot com The following code compiles on clang++ but not on g++ 4.9.0. ``` struct A { template<int i> inline int a() { return 0; } template<int i> inline auto b() -> decltype(a<i>()) { return a<i>(); } }; int main() { A a; a.b<2>(); } ``` g++ can compile it if I change `decltype(a<i>())` to `decltype(this->a<i>())` System Info. ArchLinux x86_64 with [testing] [multilib] and [multilib-testing] enabled. Using official gcc package from ArchLinux. Command line to compile the program above g++/clang++ --std=c++11 gcc.cpp -c where gcc.cpp is the name of the source file.