This makes C++/objC not totally broken, without hurting C files too much.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
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?
clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
24 ↗ | (On Diff #141662) | Maybe use .equals_lower(".h") instead? Just in case. |
Comment Actions
Will try to add a test.
clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
24 ↗ | (On Diff #141662) | .H is (unambiguously) c++, and will be treated as such by clang. |
clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
24 ↗ | (On Diff #141662) | Wasn't aware of that convention, thanks. |
Comment Actions
Added a unit test, and cleaned up a couple of things to make it pass:
- GlobalCompilationDatabase.h wasn't self-contained due to incomplete types
- testPath() isn't very usable with subdirectories on windows
clangd/GlobalCompilationDatabase.cpp | ||
---|---|---|
24 ↗ | (On Diff #141662) | Yeah .C/.H is rare these days I think. (But present in Driver/Types.cpp) |