Search

C4743 warning on explicit call of a templated function by Dmitry Me

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 698148
Opened: 10/31/2011 6:20:20 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
0
User(s) can reproduce this bug
This behavior is observed in cl.exe 16.00.40219.1

I have this code:


#pragma warning(default:4347)

template <size_t param>
void stuff( int value )
{
}

void stuff( int value )
{
    stuff<4>( value ); //Line 84
}

that I compile with /W4 and get this output:

1>Test.cpp(84): warning C4347: behavior change: 'void stuff<4>(int)' is called instead of 'void stuff(int)'

that makes no sense. Line 84 explicitly calls a templated function, there's no way a non-templated function would be called here and therefore there's no behavior change. The warning is just wrong.
Details (expand)

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

Visual Studio 2010 SP1

Steps to reproduce

Compile the code above, inspect compiler output.

Product Language

English

Operating System

Windows XP

Operating System Language

English

Actual results

C4743 warning emitted.

Expected results

C4743 warning should not be emitted.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 1/13/2012 at 8:40 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-Moderator07 [Feedback Moderator] on 10/31/2011 at 7:17 PM
Thanks for your feedback.

We are rerouting 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 MS-Moderator01 on 10/31/2011 at 6:41 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.