Bug 370928 - Kdevelop parser issues with with typedefs not recognized.
Summary: Kdevelop parser issues with with typedefs not recognized.
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 5.0.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-15 21:08 UTC by Ted
Modified: 2017-01-02 04:04 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ted 2016-10-15 21:08:57 UTC
I have  a CPP file with some typedef's and variables declarations.
These do not appear to get recognized by the parser unless I have the declaration right before the usage in the .cpp file.




Reproducible: Always


Actual Results:  
Parser flags valid code as error.

Expected Results:  
Parser should not flag these as errors.

Here is an example:

typedef map<int, afdx_hdl_t> TX_PORT_MAP_T;
typedef struct VL_ENTRY_T
	{
		afdx_hdl_t	VL_Hdl;
		TX_PORT_MAP_T	portMap;
	}VL_ENTRY;
typedef map<int, VL_ENTRY> TX_VL_MAP_T;
TX_VL_MAP_T m_TxVlMap;

.....

TX_VL_MAP_T::iterator vlMapIter = m_TxVlMap.find(txVLInfo.VL_ID);

I show these errors with the parser unless the above declarations appear immediately above the usage.

Problem in Semantic analysis
'TX_VL_MAP_T' (aka 'int') is not a class, namespace, or enumeration

m_TxVlMap
Problem in Semantic analysis
Member reference base type 'TX_VL_MAP_T' (aka 'int') is not a structure or union

This code compiles with no warnings/errors.
Comment 1 Ted 2016-10-16 02:36:37 UTC
Forgot one typedef:

typedef int afdx_hdl_t;
Comment 2 Ted 2016-12-29 19:48:46 UTC
The whole problem was relying on the Makefile to supply the include paths.
Apparently KDevelop does not parse pkg-config entires in the Makefile.
I added the needed include files paths in Kdevelop and resolved the problem.
Comment 3 Ted 2017-01-02 04:04:34 UTC
I would like to add a comment that may help others stumbling across this issue.

If there are any RED issues reported in Problems for include files, the parser will not work.  You must resolve these problems in order for the parser to work again.