<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think warning that we don't know the right compile flags is a great idea.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 30, 2018, at 11:47, Sam McCall <<a href="mailto:sammccall@google.com" class="">sammccall@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class="">That's a good point. Somehow I forgot obj-c++ was a thing... We should switch this.<div dir="auto" class=""><br class=""></div><div dir="auto" class="">One silly downside though - I find just "-x c++" won't actually give useful results on real projects.</div><div dir="auto" class="">Does this match others' experience?</div><div dir="auto" class="">The "Unknown type name 'namespace'" error I tend to get from the current behavior is at least predictable and recognizable. If we were parsing as obj-c++ but missing other flags, problems could be more subtle.</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">But we could of course do even better here - if the CDB could report when a command is fallback/inferred, clangd could insert a warning at the first line of the file. "No compile flags found, using 'clang -x objective-c++'" or so.</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">What do you think?</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Mar 30, 2018, 18:55 Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" class="">dexonsmith@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
> On Mar 26, 2018, at 01:22, Sam McCall via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class="">
><br class="">
> When there's no compile command provided, we fall back to 'clang $filename'. Clang treats .h files as C.<br class="">
<br class="">
I wonder if, as a fallback, `clang -x objective-c++ $filename` would be more generally useful... it puts Clang into "accept almost everything" mode.  This is the mode LLDB uses for expression evaluation IIRC.<br class="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>