<div dir="auto">That's a good point. Somehow I forgot obj-c++ was a thing... We should switch this.<div dir="auto"><br></div><div dir="auto">One silly downside though - I find just "-x c++" won't actually give useful results on real projects.</div><div dir="auto">Does this match others' experience?</div><div dir="auto">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"><br></div><div dir="auto">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"><br></div><div dir="auto">What do you think?</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 30, 2018, 18:55 Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.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 Mar 26, 2018, at 01:22, Sam McCall via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> When there's no compile command provided, we fall back to 'clang $filename'. Clang treats .h files as C.<br>
<br>
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>
</blockquote></div>