Search

MSVC allows virt-specifiers in for each loop by Ivan Sorokin

Closed
as Deferred Help for as Deferred

1
0
Sign in
to vote
Type: Bug
ID: 779230
Opened: 2/14/2013 9:00:40 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
MSVC accepts the following code:

#include <vector>

int main()
{
    std::vector<int(*)()> v;

    for each (int (*a)() override in v)
    {}
}

I believe this code is incorrect because of presence of override virt-specifier.
Details (expand)

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

Visual Studio 2012

Steps to reproduce

#include <vector>

int main()
{
    std::vector<int(*)()> v;

    for each (int (*a)() override in v)
    {}
}

Product Language

English

Operating System

Windows 8

Operating System Language

English

Actual results

MSVC accepts this code.

Expected results

syntax error 'override'
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 2/14/2013 at 7:52 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 Microsoft on 2/14/2013 at 9:54 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.