Skip to content

Commit f30f68f

Browse files
fix: compiling C source file without -std=c++20 (#334)
1 parent dd8f0dd commit f30f68f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Compiler/Command.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,11 @@ CompilationContext CompilationDatabase::lookup(llvm::StringRef file,
690690
if(info) {
691691
directory = self->strings.get(info->directory);
692692
arguments = self->mangle_command(file, *info, options);
693-
} else {
693+
// TODO: other c++ suffixes
694+
} else if(file.ends_with(".cpp") || file.ends_with(".hpp") || file.ends_with(".cc")) {
694695
arguments = {"clang++", "-std=c++20"};
696+
} else {
697+
arguments = {"clang"};
695698
}
696699

697700
auto append_arg = [&](llvm::StringRef s) {

0 commit comments

Comments
 (0)