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 207319

Summary: Code completion provides element which is not applicable in the second context
Product: cnd Reporter: yuriy_lalym <yuriy_lalym>
Component: Code ModelAssignee: Vladimir Voskresensky <vv159170>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description yuriy_lalym 2012-01-14 21:54:04 UTC
Заимствовано отсюда https://bugs.eclipse.org/bugs/show_bug.cgi?id=197989#c102

test.h
-------------------------

#ifndef TEST_H_
#define TEST_H_

struct S
{
#ifdef MYMACRO
    void foo();
#else
    void bar();
#endif
};

#endif /* TEST_H_ */

main.cpp
-------------------------

#define MYMACRO
#include "test.h"

int main()
{
  S s;
  s.foo(); // s. Autocompletion gives one variant foo(); good

  return 0;
}

test.cpp
-------------------------

#include "test.h"

int test()
{
  S s;
  s.foo(); // s. Autocompletion gives and foo() and bar(); ERROR
}