https://bugs.llvm.org/show_bug.cgi?id=44473

            Bug ID: 44473
           Summary: Different behavior for #include when using -iquote
                    with/without header maps
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Driver
          Assignee: unassignedclangb...@nondot.org
          Reporter: 6f6...@gmail.com
                CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
                    richard-l...@metafoo.co.uk

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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to