[PATCH] D45442: Parse .h files as objective-c++ if we don't have a compile command.
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 10 05:00:34 PDT 2018
ilya-biryukov added a comment.
ObjC++ definitely seems like a nicer default. Unfortunately, we'll start getting ObjC++ completion results, which may be confusing. But that seems like a smaller evil.
Is there an easy way to add a regression test that checks we don't get any errors for headers without compile command with C++/ObjC++ code?
================
Comment at: clangd/GlobalCompilationDatabase.cpp:24
+ // Parsing as Objective C++ is friendly to more cases.
+ if (llvm::sys::path::extension(File) == ".h")
+ Argv.push_back("-xobjective-c++-header");
----------------
Maybe use `.equals_lower(".h")` instead? Just in case.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45442
More information about the cfe-commits
mailing list