<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Missing includes inhibits getting correct inheritance information."
href="https://bugs.llvm.org/show_bug.cgi?id=38155">38155</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Missing includes inhibits getting correct inheritance information.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>libclang
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>6yearold@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>klimek@google.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When running
# c-index-test -index-file test.cpp
on this file:
#include "missing1.h"
template<class T>
class A
{
T a;
};
//#include "missing2.h"
class B : public A<int>
{
};
I get the following output:
[startedTranslationUnit]
[enteredMainFile]: /home/arr/test.cpp
[ppIncludedFile]: (null) | name: "missing1.h" | hash loc: 1:1 | isImport: 0 |
isAngled: 0 | isModule: 0
[indexDeclaration]: kind: c++-class-template | name: A | USR: c:@ST>1#T@A |
lang: C++ | cursor: ClassDecl=A:4:7 (Definition) | loc: 4:7 |
semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 |
isContainer: 1 | isImplicit: 0
[indexDeclaration]: kind: field | name: a | USR: c:@ST>1#T@A@FI@a | lang: C++ |
cursor: FieldDecl=a:6:7 (Definition) | loc: 6:7 | semantic-container: [A:4:7] |
lexical-container: [A:4:7] | isRedecl: 0 | isDef: 1 | isContainer: 0 |
isImplicit: 0
[indexDeclaration]: kind: c++-class | name: B | USR: c:@S@B | lang: C++ |
cursor: ClassDecl=B:11:7 (Definition) | loc: 11:7 | semantic-container: [TU] |
lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit:
0
<base>: kind: c++-class-template | name: A | USR: c:@ST>1#T@A | lang: C++
| cursor: C++ base class specifier=A<int>:4:7 [access=public isVirtual=false] |
loc: 11:11
[indexEntityReference]: kind: c++-class-template | name: A | USR: c:@ST>1#T@A |
lang: C++ | cursor: TemplateRef=A:4:7 | loc: 11:18 | <parent>:: kind: c++-class
| name: B | USR: c:@S@B | lang: C++ | container: [B:11:7] | refkind: direct
[diagnostic]: /home/arr/test.cpp:1:10: fatal error: 'missing1.h' file not found
However, if I uncomment #include "missing2.h" line, the output changes to
[startedTranslationUnit]
[enteredMainFile]: /home/arr/test.cpp
[ppIncludedFile]: (null) | name: "missing1.h" | hash loc: 1:1 | isImport: 0 |
isAngled: 0 | isModule: 0
[ppIncludedFile]: (null) | name: "missing2.h" | hash loc: 9:1 | isImport: 0 |
isAngled: 0 | isModule: 0
[indexDeclaration]: kind: c++-class-template | name: A | USR: c:@ST>1#T@A |
lang: C++ | cursor: ClassDecl=A:4:7 (Definition) | loc: 4:7 |
semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 |
isContainer: 1 | isImplicit: 0
[indexDeclaration]: kind: field | name: a | USR: c:@ST>1#T@A@FI@a | lang: C++ |
cursor: FieldDecl=a:6:7 (Definition) | loc: 6:7 | semantic-container: [A:4:7] |
lexical-container: [A:4:7] | isRedecl: 0 | isDef: 1 | isContainer: 0 |
isImplicit: 0
[indexDeclaration]: kind: c++-class | name: B | USR: c:@S@B | lang: C++ |
cursor: ClassDecl=B:11:7 (Definition) | loc: 11:7 | semantic-container: [TU] |
lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit:
0
[diagnostic]: /home/arr/test.cpp:1:10: fatal error: 'missing1.h' file not found
The difference between outputs is
- <base>: kind: c++-class-template | name: A | USR: c:@ST>1#T@A | lang: C++
| cursor: C++ base class specifier=A<int>:4:7 [access=public isVirtual=false] |
loc: 11:11
-[indexEntityReference]: kind: c++-class-template | name: A | USR: c:@ST>1#T@A
| lang: C++ | cursor: TemplateRef=A:4:7 | loc: 11:18 | <parent>:: kind:
c++-class | name: B | USR: c:@S@B | lang: C++ | container: [B:11:7] | refkind:
direct
This prevents getting correct information about class B when using libclang
from KDevelop.</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>