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 219187 - Code assist does not work with const auto and BOOST_FOREACH
Summary: Code assist does not work with const auto and BOOST_FOREACH
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Completion (show other bugs)
Version: 7.2
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-28 12:47 UTC by zachsaw
Modified: 2015-02-04 15:07 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 zachsaw 2012-09-28 12:47:12 UTC
#include <boost/foreach.hpp>
#include <boost/shared_ptr.hpp>

#define foreach BOOST_FOREACH

class MyClass
{
public:
    void Test() { }
};

int main()
{
    std::vector<boost::shared_ptr<MyClass>> myClasses;
    boost::shared_ptr<MyClass> foo(new MyClass());
    myClasses.push_back(foo);
    foreach (const auto& myClass, myClasses)
    {
        myClass-> // code assistance shows "No suggestions"
    }

    return 0;
}
Comment 1 zachsaw 2012-09-29 00:55:21 UTC
Additional note:

    foreach (const auto& myClass, myClasses)
    {
        myClass->Test();
    }

Test() is underlined red.
However, it compiles fine.
Comment 2 zachsaw 2012-09-29 00:57:45 UTC
Another example:

    auto bar = myClasses[0];
    bar->Test(); // this is fine
    foreach (auto myClass, myClasses)
    {
        myClass->Test(); // Test() underlined red.
    }
    foreach (const auto& myClass, myClasses)
    {
        myClass->Test(); // Test() underlined red.
    }
Comment 3 Quality Engineering 2014-03-25 03:10:01 UTC
Integrated into 'main-silver', will be available in build *201403250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f6d37162d773
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #219187 - Code assist does not work with const auto and BOOST_FOREACH
Comment 4 Quality Engineering 2014-04-01 02:11:57 UTC
Integrated into 'main-silver', will be available in build *201404010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f539690a8328
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Additional fix for #219187 - temporary commented sizeof calculation to repair tests on LLVM
Comment 5 Quality Engineering 2014-04-24 02:06:23 UTC
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/1eb86411f9bc
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #219187 - Code assist does not work with const auto and BOOST_FOREACH
(transplanted from f6d37162d773e1501e971af2a924698e9f47732a)
Comment 6 petrk 2015-02-04 15:07:14 UTC
Seems it got fixed after http://hg.netbeans.org/cnd-main/rev/bfd39103cfd8