This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49356] New: C++0x decltype fails with recursive template function
- From: "jarrydb at cse dot unsw.edu.au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Jun 2011 02:01:37 +0000
- Subject: [Bug c++/49356] New: C++0x decltype fails with recursive template function
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49356
Summary: C++0x decltype fails with recursive template function
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jarrydb@cse.unsw.edu.au
Created attachment 24483
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24483
Recursion with decltype fails.
When decltype refers to the type of a recursive instantiation of the same
template function, it fails. The command line and output for the attached file
(the preprocessed version is attached) is as follows:
g++ --std=gnu++0x recurse.cpp -fmessage-length=72 -save-temps
recurse.cpp: In function âint main(int, char**)â:
recurse.cpp:43:20: error: no matching function for call to âmultiply(
Multiplier&, int, int, int)â
recurse.cpp:43:20: note: candidates are:
recurse.cpp:25:22: note: template<class T, class Last> decltype
(t(last)) multiply(T&, Last)
recurse.cpp:33:40: note: template<class T, class First, class ...
Values> decltype (multiply(t(f), multiply::values ...)) multiply(T&,
First, Values ...)
Here are my gcc specs.
g++ -v:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/jarryd/current/soft/install-latest/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/jarryd/current/soft/src/gcc-svn/configure
--prefix=/home/jarryd/current/soft/install-latest --disable-multilib
--enable-languages=c,c++,go : (reconfigured)
/home/jarryd/current/soft/src/gcc-svn/configure
--prefix=/home/jarryd/current/soft/install-latest --disable-multilib
--enable-languages=c,c++,go,lto --no-create --no-recursion
Thread model: posix
gcc version 4.7.0 20110609 (experimental) (GCC)