http://llvm.org/bugs/show_bug.cgi?id=15244

            Bug ID: 15244
           Summary: Code completion fails with tricky macro
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Test program source code:
/* test.c */
#include "test.h"
#include <stdio.h>

int main()
{
    struct test_struct test;
    test.sth2_1 = 123;    /* Here is the problem! */

    printf("%d\n", test.sth2.sth1_in_sth2);
}

/* test.h */
#define sth2_1 sth2.sth1_in_sth2

struct test_struct
{
    int sth1;
    struct
    {
        int sth1_in_sth2;
        int sth2_in_sth2;
    } sth2;
};

When I typed 'test.', clang gives me the following:

COMPLETION: sth1 : [#int#]sth1
COMPLETION: sth2 : [#struct <anonymous>#]sth2

But actually, using test.sth2_1 is also acceptable. The above test problem can
be compiled properly and gives me the expected result (output '123'). What I
*expected* from clang is:

COMPLETION: sth1 : [#int#]sth1
COMPLETION: sth2 : [#struct <anonymous>#]sth2
COMPLETION: sth2_1 : [#int#]sth2.sth1_in_sth2 (or [#int#]sth2_1)

Is there any solution?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to