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 - Code completion provides element which is not applicable in the second context
Summary: Code completion provides element which is not applicable in the second context
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-14 21:54 UTC by yuriy_lalym
Modified: 2013-05-21 15:29 UTC (History)
0 users

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 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
}