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 216095 - Not able to resolve some identifiers from heavily templated C++ libraries
Summary: Not able to resolve some identifiers from heavily templated C++ libraries
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-28 16:27 UTC by lowsfer
Modified: 2016-02-02 13:35 UTC (History)
2 users (show)

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 lowsfer 2012-07-28 16:27:21 UTC
I'm working on C++ numerical computing and need to use heavily templated libraries for performance.

The problem is netbeans code parser fails to resolve some identifiers, mainly member function of templated objects. It can resolve the name of the templated objects but not the member functions.

I have tested with Eigen and Blitz++. Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page) is a very small header-files-only library and the problem can be reproduced with a piece of simple code: (Identifier "Random" and "row" not resolved. I did order netbeans to reparse the project.)

*****************************code****************************
#include <cstdlib>
#include <iostream>
#include <eigen3/Eigen/Dense> //need Eigen head files

using namespace std;
using namespace Eigen;

int main(int argc, char** argv)
{
    MatrixXd mat(MatrixXd::Random(4, 4)); //Unable to resolve identifier Random
    cout << mat.row(2) << endl; //Unable to resolve identifier row
    return EXIT_SUCCESS;
}
*****************************code***************************

Note not all templated object will suffer from this problem. For instance, STL vector work without such problem. Probably because STL objects are not so heavily templated as high performance numerical libraries like Eigen and Blitz.

I also tested with other IDEs on linux. Eclipse+CDT worked perfectly while Kdevelop behaved similarly to Netbeans.
Comment 1 lowsfer 2012-07-28 16:30:02 UTC
Sorry I forgot to say the code can be compiled and executed without problem (tested with g++ and Intel icpc). So the Eigen library and the simple code should be OK. Must be a parser problem.
Comment 2 Alexander Pepin 2012-09-24 16:38:50 UTC
Probably Eigen should be added to accuracy tests
Comment 3 Quality Engineering 2016-01-28 02:34:50 UTC
Integrated into 'main-silver', will be available in build *201601280002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9696cc42ffa8
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixed #216095 - Not able to resolve some identifiers from heavily templated C++ libraries
(transplanted from 79a64f33ed9dff4eb54d0c9105e164d2f392a3e5)
Comment 4 petrk 2016-01-28 09:33:47 UTC
Fixed at enum: 305722:79a64f33ed9d
Comment 5 soldatov 2016-02-02 13:35:51 UTC
Verified in NetBeans 8.1 patch1