Skip to content

Commit cfdb8ac

Browse files
committed
Pass in clang as arg[0] when invoking clang via the clang importer. Clang is expecting an argv[0] argument.
1 parent 58a6f60 commit cfdb8ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,10 @@ ClangImporter::create(ASTContext &ctx,
489489

490490
std::vector<std::string> invocationArgStrs;
491491

492+
// Clang expects this to be like an actual command line. So we need to pass in
493+
// "clang" for argv[0]
494+
invocationArgStrs.push_back("clang");
495+
492496
switch (importerOpts.Mode) {
493497
case ClangImporterOptions::Modes::Normal:
494498
getNormalInvocationArguments(invocationArgStrs, ctx, importerOpts);

0 commit comments

Comments
 (0)