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 218848 - auto in for loop produces not recognized
Summary: auto in for loop produces not recognized
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-22 22:13 UTC by pjulien
Modified: 2014-04-18 11:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot (11.17 KB, image/png)
2014-01-12 12:54 UTC, SteelRat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pjulien 2012-09-22 22:13:20 UTC
Similar to bug #215662 but inside a for loop

The following works:

for (Foo *p : v) {
  p->bar();
}

This does not

for (auto p : v) {
  p->bar();
}

Gcc 4.7 is able to compile it and it can run from netbeans
Comment 1 nnnnnk 2012-10-18 13:29:19 UTC
fixed:
http://hg.netbeans.org/cnd-main/rev/928fe71ed0c0
Comment 2 Quality Engineering 2012-10-19 13:38:15 UTC
Integrated into 'main-golden', will be available in build *201210191216* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/928fe71ed0c0
User: Nikolay Krasilnikov <nnnnnk@netbeans.org>
Log: fixed #218848 - auto in for loop produces not recognized
Comment 3 pjulien 2012-10-19 19:27:44 UTC
This works for me

(In reply to comment #2)
> Integrated into 'main-golden', will be available in build *201210191216* on
> http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
> Changeset: http://hg.netbeans.org/main-golden/rev/928fe71ed0c0
> User: Nikolay Krasilnikov <nnnnnk@netbeans.org>
> Log: fixed #218848 - auto in for loop produces not recognized
Comment 4 SteelRat 2014-01-12 12:54:42 UTC
Created attachment 143859 [details]
Screenshot
Comment 5 SteelRat 2014-01-12 12:54:53 UTC
NetBeans IDE 7.4 (Build 201310111528)
Linux version 3.8.0-35

Still receive "Unable to receive identifier...":
std::vector< std::vector<float> > vectors;
for (auto &vector : vectors) {
  float *pointer = vector.data(); // Unable to resolve identifier data.
  int *size = vector.size(); // Unable to resolve identifier size.
}

Explicitly specifying the type resolve bug:
std::vector< std::vector<float> > vectors;
for (std::vector<float> &vector : vectors) {
  float *pointer = vector.data(); // Unable to resolve identifier data.
  int *size = vector.size(); // Unable to resolve identifier size.
}

Both examples compile successfully.
Comment 6 petrk 2014-04-18 11:35:07 UTC
Works in nightly build. If for some reason it won't work for you, please, reopen bug and provide info about your compiler.