<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 - Different behavior for #include when using -iquote with/without header maps"
href="https://bugs.llvm.org/show_bug.cgi?id=44473">44473</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Different behavior for #include when using -iquote with/without header maps
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>Driver
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>6f6231@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>When using the -iquote flag to clang, the behavior of an #include directive is
different if the argument passed is a directory or a header map.
This works as expected:
$ cat test.c
#include "foo.h"
int bar() { return foo(); }
$ cat some/include/path/foo.h
int foo(void);
$ clang -c -iquote some/include/path test.c
$
However, if foo.h comes via a header map:
$ ~/bin/hmapdump headers.hmap
Header:
Magic: hmap
Version: 1
Reserved: 0
StringsOffset: 72
NumEntries: 3
NumBuckets: 4
MaxValueLength: 23
Buckets:
0: empty
1: empty
2: 1 7 26
3: empty
StringsTable:
0:
1: foo.h
7: some/include/path/
26: foo.h
Entries:
[2] 'foo.h' -> 'some/include/path/' 'foo.h'
$ clang -c -iquote headers.hmap test.c
test.c:1:10: fatal error: 'foo.h' file not found
#include "foo.h"
^~~~~~~
1 error generated.
Is this by design or is it a bug?</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>