This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54111] New: function return type template deduction
- From: "leonid at volnitsky dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 28 Jul 2012 07:45:53 +0000
- Subject: [Bug c++/54111] New: function return type template deduction
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54111
Bug #: 54111
Summary: function return type template deduction
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: leonid@volnitsky.com
Created attachment 27882
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27882
4 source code files.
Possible regression.
There are 4 version of slightly different versions of below code (file
bug-u2.cc):
-----------------------------------------------------
#include <tuple>
template<typename T, typename U>
U operator* (T x, U& (*f)(T&) ) {
return (*f)(x);
};
int main() {
std::tuple<int,int> tpl(42,43);
return tpl * std::get<0,int,int>;
}
----------------------------------------------------
These 4 versions are combination of 2 variants:
- if template parameter U or hardcoded type int is used (codes int or u)
- if get<0,int,int> or get<0> is used (codes 2 and 0)
4 version of above code are attached.
For 3 versions of GCC that I have:
453 471 480-pre
--------------------------------------
bug-int0.cc accp accp accp
bug-int2.cc accp rej rej
bug-u0.cc rej rej rej
bug-u2.cc accp rej rej
It seems that gcc463 behave the same as 453.