Search

C2216 'override' cannot be used with 'inline' by Dmitriy Ovdienko

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 684900
Opened: 8/19/2011 11:47:33 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
0
User(s) can reproduce this bug
I cannot compile method with inline and override specifiers.
Details (expand)

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

Visual Studio 2010 SP1

Steps to reproduce

I cannot compile code like this:
[code]
class A
{
public:
    virtual void foo() {}
};

class B: public A
{
public:
    inline virtual void foo() override {}
};

int main()
{

}
[/code]

However I can compile same without "inline":
[code]
class A
{
public:
    virtual void foo() {}
};

class B: public A
{
public:
    virtual void foo() override {}
};

int main()
{

}
[/code]

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

error C2216: 'override' cannot be used with 'inline'

Expected results

No errors.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 8/22/2011 at 11:45 AM
Hi Dmitriy:
    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-Moderator10 [Feedback Moderator] on 8/21/2011 at 7:23 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 8/20/2011 at 12: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.