Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318604 - No support for repetitive inclusion of same file to (un)define macros, e.g. boost/filesystem.hpp
Summary: No support for repetitive inclusion of same file to (un)define macros, e.g. b...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
: 372598 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-01 10:21 EDT by Sebastian Bauer CLA
Modified: 2012-04-04 02:39 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Bauer CLA 2010-07-01 10:21:23 EDT
Build Identifier: I20100608-0911

This bug is related to Bug 318130 but this addresses the problem of the indexer. I'm using CDT 7.0.

It seems that the indexer has problems with some constructs that can be (for instance) found in the boost filesystem API. The basic text example looks as:

#include <boost/filesystem.hpp>

namespace fs = ::boost::filesystem;

int main(void)
{
	fs::directory_iterator itr("/home/sba");
	itr->status();

	return 0;
}


Reproducible: Always

Steps to Reproduce:
1. Create a new C++ project
2. Add the file given above (test.c).
3. Try to enter itr-> somewhere in main and press CTRL+Space (to bring up the content assist)
4. Observe that no suggestions are made.

5. Go to shell and run GCCs preprocessor on the file, e.g., "gcc test.c -E >test2.c"
6. Refresh the project to see the new file test2.c in the project.
7. Rebuild the index of the project
8. Go to the bottom of the file and observe that the content assist shows suggestions. Interestingly, the same works now also for the original test.c file.

It seems that something that is normally not emitted by the GCC preprocessor disturbes the CDT indexer, or the indexer has some problems with including files.
Comment 1 Markus Schorn CLA 2010-07-01 10:24:24 EDT
What is the problem you are observing?
Comment 2 Sebastian Bauer CLA 2010-07-01 10:43:36 EDT
At the state of point 4, the content assist doesn't provide any completion suggestions for the itr-> contruct. Other components such as the refactoring don't seem to work if that information is not available (see Bug 318130).

That it does provide completion suggestions at the state of point 8 is an additional observation, which could help to track down the problem.
Comment 3 Markus Schorn CLA 2010-07-02 04:55:24 EDT
I can reproduce the problem. Root cause seems to be the pattern:

// header a.h and b.h
#include <boost/type_traits/detail/bool_trait_def.hpp>
....
#include <boost/type_traits/detail/bool_trait_undef.hpp>


// source a.cpp
#include "a.h"
#include "b.h"  // we don't look at bool_trait_def.hpp and miss some macros
Comment 4 Nathan Ridge CLA 2012-01-12 22:49:57 EST
This works for me with the latest Juno build. I think the fix to Bug 197989 is what fixed it.
Comment 5 Markus Schorn CLA 2012-01-13 01:19:58 EST
(In reply to comment #4)
> This works for me with the latest Juno build. I think the fix to Bug 197989 is
> what fixed it.

Thanks, you are right.
Comment 6 Markus Schorn CLA 2012-04-04 02:39:07 EDT
*** Bug 372598 has been marked as a duplicate of this bug. ***