Subject: Re: bug#32773: clang: missing default include paths for C++

From: Tim Gesthuizen <[email-masked]>
Date: Wed, 19 Sep 2018 20:47:45 +0200

On 19.09.2018 20:33, Pjotr Prins wrote:
> Hi Tim,
> 
> I am not sure this helps but in a project I have I use 
> 
>   CPPFLAGS= -std=c++11 
> 
> and
> 
>   CPPFLAGS += -I$(GUIX)/include/c++ -I$(GUIX)/include/c++/x86_64-unknown-linux-gnu
> 
> to find include files in Guix context with clang. Where $(GUIX) is the
> profile.
> 
> Similar to yours. Glad to hear of a better way.

Yes, that seems to be quite the same to my workaround.
Its just that this is  a workaround that is difficult to get working in
some contexts: I want to use emacs-irony-mode through guix which is not
really useable because it won't autocomplete any std::* stuff.
If you take all packages that might want to use libclang and other
features of clang it might be a better solution to find a proper fix for
this problem. Also both workarounds need a user profile that is
cluttered with all include files.
I had a quick look into clangs source code how C_INCLUDE_DIRS is
implemented. It should be more or less easy to add the same option for
C++ (even C_INCLUDE_DIRS seems to be tinkered in to me).
I just wanted to file a bug about this because fixing this is not
trivial and I am not sure whether I will find the time right away to fix it.
Fixing it would also have the benefit that I could send the patch to the
LLVM mailing list and we might see the change upstream in the next LLVM
version.

Tim.