Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326778 - Questionable ambiguity if both using declaration and using directive is used
Summary: Questionable ambiguity if both using declaration and using directive is used
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 7.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.0.2   Edit
Assignee: Project Inbox CLA
QA Contact: Mike Kucera CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-01 09:36 EDT by Jens Elmenthaler CLA
Modified: 2010-10-07 03:17 EDT (History)
0 users

See Also:


Attachments
testcase + fix (2.44 KB, patch)
2010-10-06 10:05 EDT, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Elmenthaler CLA 2010-10-01 09:36:45 EDT
Build Identifier: HEAD

Create a C/C++ project containing the following two files:

// sabel.hpp
#include <iostream>
using std::cout;

// sabel.cpp
#include "sabel.hpp"
using namespace ::std;

void sabel()
{
  cout << "test";
}

"cout" will be reported as a name resolution problem that looks like an ambiguity. If I remove the using directive in the source file or the using declaration in the header file, the indexer doesn't complain. Additionally, if I move the using declaration into the source file, the indexer does not complain either.

Reproducible: Always
Comment 1 Markus Schorn CLA 2010-10-04 03:33:31 EDT
Thanks, I'll have a look at this.
Comment 2 Markus Schorn CLA 2010-10-06 10:05:51 EDT
Created attachment 180332 [details]
testcase + fix
Comment 3 Markus Schorn CLA 2010-10-06 10:07:02 EDT
Fixed in 7.0.2 and 8.0 > 20101006.
Comment 6 Jens Elmenthaler CLA 2010-10-07 03:17:43 EDT
(In reply to comment #3)
> Fixed in 7.0.2 and 8.0 > 20101006.
Hey, you cut the percentage of unresolved names in half for my workspace!! This example was extracted from usages of the ACE libraries, so I'm possible not alone.

Anyway, with the name resolution problem now being shown in the problems view, I expect that the indexer will climb a compiler-like level of correctness with Indigo.

Thanks again for this fix.