Search

Invalid line number in compiler output by tarekon

Closed
as Deferred Help for as Deferred

2
0
Sign in
to vote
Type: Bug
ID: 779195
Opened: 2/14/2013 1:40:47 AM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug
C++ compiler prints wrong line number in error message for the last identifier in line in
multiline expression.

Example:
int function()
{
    return a + b
        + c;
}

where all identifiers are undefined, compiler prints:

source.cpp(4): error C2065: 'b' : undeclared identifier
source.cpp(4): error C2065: 'c' : undeclared identifier

but "b" and "c" are placed on different lines.
Details (expand)

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

Visual Studio 2012

Steps to reproduce

1. Create empty C++ project
2. Add new item - C++ file (.cpp)
3. Fill it with following:
int function()
{
    return a + b
        + c;
}
4. Try to compile

Product Language

English

Operating System

Windows 7 SP1

Operating System Language

English

Actual results

source.cpp(3): error C2065: 'a' : undeclared identifier
source.cpp(4): error C2065: 'b' : undeclared identifier
source.cpp(4): error C2065: 'c' : undeclared identifier

Expected results

source.cpp(3): error C2065: 'a' : undeclared identifier
source.cpp(3): error C2065: 'b' : undeclared identifier
source.cpp(4): error C2065: 'c' : undeclared identifier
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 2/14/2013 at 8:05 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 1: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.