This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 261006 - "using namespace std" breaks "introduce variable" in simple scenario
Summary: "using namespace std" breaks "introduce variable" in simple scenario
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.2
Hardware: PC Solaris
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-10 14:33 UTC by soldatov
Modified: 2016-07-13 01:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2016-05-10 14:33:24 UTC
Code:

#include <iostream>

using namespace std;

int main(int argc, char** argv) {
    1 + 2;
    return 0;
}

Scenario:
- Select "1 + 2"
- Press Alt+Shift+V (Refactor|Introduce Variable...)
==> I see
Name: variable
Type: basic_string<int,_Traits,_Alloc>

P.S. If I comment "using namespace std" line I see correct type in Introduce Variable window
Comment 1 Alexander Simon 2016-05-19 10:53:45 UTC
Code model returns wrong type of a selection.
Comment 2 petrk 2016-07-11 15:46:07 UTC
Fixed in http://hg.netbeans.org/cnd-main/rev/cd66f4f1a673
Comment 3 Quality Engineering 2016-07-12 01:52:48 UTC
Integrated into 'main-silver', will be available in build *201607120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cd66f4f1a673
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #261006 - "using namespace std" breaks "introduce variable" in simple scenario
Comment 4 Quality Engineering 2016-07-13 01:49:34 UTC
Integrated into 'main-silver', will be available in build *201607130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/bddd90102a3b
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Additional fix for #261006 - "using namespace std" breaks "introduce variable" in simple scenario