This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61400] suffix return type doesn't work for template member functions with explict specialization
- From: "yyc1992 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jun 2014 05:12:02 +0000
- Subject: [Bug c++/61400] suffix return type doesn't work for template member functions with explict specialization
- Auto-submitted: auto-generated
- References: <bug-61400-4 at http dot gcc dot gnu dot org/bugzilla/>
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>())
```