Search

error C2563: mismatch in formal parameter list by Jinhao.CPP

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 712925
Opened: 12/9/2011 10:22:26 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
0
User(s) can reproduce this bug
void foo(int){}
void foo(){}

template<typename Ft>
struct T
{
    T(){}
    T(Ft){}
};

int main()
{
    T<void()> t;
    t = foo; //Error, the foo() should be matched by overload resolution.
}

generates this error:
error C2563: mismatch in formal parameter list
error C2568: '=' : unable to resolve function overload
could be 'void foo(void)'
or     'void foo(int)'
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling version

Visual Studio 2010 SP1

Steps to reproduce

Compiled with VC2010 sp1

Product Language

English

Operating System

Windows 7

Operating System Language

Chinese (Simplified)

Actual results

error C2563: mismatch in formal parameter list
error C2568: '=' : unable to resolve function overload
could be 'void foo(void)'
or     'void foo(int)'

Expected results

the 'void foo()' should be matched by overload resolution.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 1/9/2012 at 7:57 AM
Hi: this issue has been fixed. The fix should show up in a future release of Visual C++.

Thank you for reporting the issue.

Jonathan Caves
Visual C++ Compiler Team
Posted by MS-Moderator10 [Feedback Moderator] on 12/11/2011 at 6:56 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 12/9/2011 at 10:44 PM
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.