Home Dashboard Directory Help
Search

Visual C++: 'auto' Deduction Failure with Declarator-Lists and Functions with Template-Dependant Return Types by Timothy003


Status: 

Closed
 as Fixed Help for as Fixed


2
0
Sign in
to vote
Type: Bug
ID: 545958
Opened: 3/30/2010 7:49:33 PM
Access Restriction: Public
1
Workaround(s)
view
1
User(s) can reproduce this bug

Description

The following C++ code fails to compile.
Details
Sign in to post a comment.
Posted by arman_sch on 1/21/2012 at 7:17 AM
This is a huge pain; as I often have multiple definitions in my loops it basically means I can't use "auto" at all. It'd be nice to see a deadline on this fix; it's a pretty fundamental problem...
Posted by Microsoft on 4/26/2010 at 8:26 AM
Hi: a fix for this issue has been checked into the compiler sources. The fix should show up in a future release of Visual C++.

Jonathan Caves
Visual C++ Compiler Team
Posted by Microsoft on 4/5/2010 at 11:48 AM
Hi: thanks for reporting this issue. Unfortunately based on our analysis of the severity of this issue combined with our limited resoures we will not be able to fix this issue in the next release of Visual C++.

Jonathan Caves
Visual C++ Compiler Team
Posted by Microsoft on 3/31/2010 at 11:00 PM
Thank you for reporting the issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by Microsoft on 3/31/2010 at 4:02 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by arman_sch on 1/21/2012 at 3:03 PM
template<class Ty>
Ty f()
{
return Ty();
}

int main()
{
int i = int();

// sol'n 1:
auto a = i;
auto b = f<int>();

// sol'n 2:
int a = i, b = f<int>();
}