Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356730

Summary: Name resolution fails on member name in designated initializer list
Product: [Tools] CDT Reporter: Lukas Felber <l.felber>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0.2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Lukas Felber CLA 2011-09-05 08:46:44 EDT
Build Identifier: I20110613-1736

Given the following code, resolution of "f" (in file a.c) yields a ProblemBinding instead of returning the IField of the struct B (in b.h). When ctrl+clicking on "f" CDT offers to go to either b.h or c.h instead of only b.h.

Note that the problem arises only if the the code is split up into header- and source files as indicated in the comment bellow.

Reproducible: Always

Steps to Reproduce:
//a.c
#include "b.h"
#include "c.h"

struct B b = {
  .f = 3.1
};

//b.h
struct B {
  float f;
};

//c.h
struct C {
  float f;
};
Comment 1 Lukas Felber CLA 2011-09-05 09:01:55 EDT
It seams that name "f" returns "null" instead of a ProblemBinding (as I assumed).
Comment 2 Markus Schorn CLA 2011-09-07 06:58:05 EDT
Added testcase and fix.
Comment 3 CDT Genie CLA 2011-09-07 07:23:03 EDT
*** cdt git genie on behalf of Markus Schorn ***

    Bug 356730: Resolution of designated initializers

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=c4e19ace4c37879a7ef9e719b46d7defe7eb72b1
Comment 4 CDT Genie CLA 2011-09-19 08:23:10 EDT
*** cdt git genie on behalf of Markus Schorn ***

    Bug 356730: Resolution of designated initializers

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=e75a7388a05bab1a1a287cd6ae36175c26a46851