Search

Rvalue reference overloading rules by weibing

Closed
as Fixed Help for as Fixed

1
1
Sign in
to vote
Type: Bug
ID: 725876
Opened: 2/21/2012 1:43:24 AM
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(int*&)
{
}

int main()
{
    Foo(new int); //will call "void Foo(int*&)"
    Foo(new int()); //will call "void Foo(int*&&)". initialize POD to zero will also affect efficiency
    return 0;
}
Details (expand)

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

Visual Studio 2010 SP1

Steps to reproduce

compile the code

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

Foo(new int); //will call "void Foo(int*&)"
Foo(new int()); //will call "void Foo(int*&&)"

Expected results

Foo(new int); //will call "void Foo(int*&&)"
Foo(new int()); //will call "void Foo(int*&&)"
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 2/22/2012 at 2:13 PM
Hi:
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next release of Visual C++.

Xiang Fan
Visual C++ Team
Posted by MS-Moderator09 [Feedback Moderator] on 2/21/2012 at 9:29 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 review. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 2/21/2012 at 2:42 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.