https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61400
--- Comment #2 from Yichao Yu <yyc1992 at gmail dot com> --- Sorry I have just noticed that I forgot to include the error message... ``` gcc.cpp: In function 'int main()': gcc.cpp:20:12: error: no matching function for call to 'A::b()' a.b<2>(); ^ gcc.cpp:20:12: note: candidate is: gcc.cpp:10:5: note: template<int i> decltype (a<i>()) A::b() b() -> decltype(a<i>()) ^ gcc.cpp:10:5: note: template argument deduction/substitution failed: gcc.cpp: In substitution of 'template<int i> decltype (a<i>()) A::b() [with int i = 2]': gcc.cpp:20:12: required from here gcc.cpp:10:26: error: cannot call member function 'int A::a() [with int i = 2]' without object b() -> decltype(a<i>()) ```