<p dir="ltr">Note that this is about the standard c++ headers, not the builtin headers. </p>
<br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 26, 2015, 7:12 PM Argyrios Kyrtzidis <<a href="mailto:akyrtzi@gmail.com">akyrtzi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Oct 15, 2015, at 1:30 AM, Benjamin Kramer via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> currently all libclang APIs that get passed a command line expect that<br>
> there is no argv[0] in the list, i. e. no binary name at the beginning<br>
> of the command line. We later fake one<br>
> (clang::createInvocationFromCommandLine) as the invocation gets passed<br>
> down into the proper clang machinery.<br>
><br>
> This is nasty because it changes the behavior if the original clang<br>
> invocation would've used a relative path to the standard library:<br>
><br>
> cmdline: /foo/bar/bin/clang -c test.cc<br>
> std lib in: /foo/bar/include/c++<br>
> libclang sees: -c test.cc<br>
><br>
> and the stdlib is lost. This comes up if we're using a compile<br>
> database, for example ycm is using it like this.<br>
><br>
> The only sane solution I see at the moment is to add a new libclang<br>
> API that expects a full argv. Any other ideas?<br>
<br>
You are talking about inferring the resources path from argv[0], but this is not 100% correct, libclang should be including the right clang and stdlib headers for the version it was compiled with.<br>
<br>
Is there a particular reason why you can’t have libclang setup so that it can find the proper headers ?<br>
<br>
><br>
> - Ben<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br>
</blockquote></div>