This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/61400] New: suffix return type doesn't work for member functions
- 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 04:53:38 +0000
- Subject: [Bug c++/61400] New: suffix return type doesn't work for member functions
- Auto-submitted: auto-generated
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.