<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Code completion fails with tricky macro"
href="http://llvm.org/bugs/show_bug.cgi?id=15244">15244</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Code completion fails with tricky macro
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kelvin9302104@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>