Search

C++ Compiler Bug after warning C4930 by Markus Messerli

Closed
as Deferred Help for as Deferred

1
0
Sign in
to vote
Type: Bug
ID: 767036
Opened: 10/11/2012 5:26:34 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
{
dRect rc3 (dPoint (pt), dSize (sz));         // warning C4930            dRect rc4 = dRect (dPoint (pt), dSize (sz)); // ok

rc4.Empty();
}


{
dRect rc3 (dPoint (pt), dSize (sz));         // ok now
dRect rc4 = dRect (dPoint (pt), dSize (sz)); // ok

rc4.Empty();
rc3.Empty(); // but error here
}


Details (expand)

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

Visual Studio 2012

Steps to reproduce

namespace {

    struct dPoint {
        public:
            double x;
            double y;

        public:
            dPoint (double dX = 0.0, double dY = 0.0) { x = dX; y = dY; }
            dPoint (const CPoint &pt)                 { x = pt.x; y = pt.y; }
    };



    struct dSize {
        public:
            double cx;
            double cy;

        public:
            dSize (double dCX = 0.0, double dCY = 0.0) { cx = dCX; cy = dCY; }
            dSize (const CSize &sz)                     { cx = sz.cx; cy = sz.cy; }
    };



    struct dRect {
        public:
            double left;
            double top;
            double right;
            double bottom;

        public:
            dRect()                                                                     { left = top = right = bottom = 0.0; }
            dRect (double Left, double Top, double Right, double Bottom)                { left = Left; top = Top; right = Right; bottom = Bottom; }
            dRect (const dPoint &pt, const dSize &sz)                                 { left = pt.x; top = pt.y; right = pt.x + sz.cx; bottom = pt.y + sz.cy; }
            dRect (const CRect &rc)                                                     { left = rc.left; top = rc.top; right = rc.right; bottom = rc.bottom; }

            void Empty()                                                             { left = top = right = bottom = 0.0; }
    }; // struct dRect

        

    void Test()
    {
        CPoint pt;
        CSize sz;

        dPoint pt1 (pt);
        dSize sz1 (sz);
        dRect rc1 (pt1, sz1);
        dRect rc2 (pt, sz);


        dRect rc3 (dPoint (pt), dSize (sz));         // warning C4930: '`anonymous-namespace'::dRect rc3(`anonymous-namespace'::dPoint,`anonymous-namespace'::dSize)': prototyped function not called (was a variable definition intended?)
        dRect rc4 = dRect (dPoint (pt), dSize (sz)); // ok

        rc4.Empty();

        // try to uncomment
        // rc3.Empty();
    }

};

Product Language

German

Operating System

Windows 7 SP1

Operating System Language

German (Swiss)

Actual results

See steps to reproduce

Expected results

See steps to reproduce
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 10/11/2012 at 9:14 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Microsoft Visual Studio Connect Support Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 10/11/2012 at 5:50 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.