diff options
author | Haojian Wu <hokein@google.com> | 2018-04-11 09:18:18 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2018-04-11 09:18:18 +0000 |
commit | 27695da998b0934467767fe1e3c53de3dee89bf0 (patch) | |
tree | 450ddea3a8cb799882cd2938ae41d6122b7006da /clang/lib/Tooling/InterpolatingCompilationDatabase.cpp | |
parent | 9f0b8e8025192f127918677ebf6ec005bbbc5ec1 (diff) | |
download | bcm5719-llvm-27695da998b0934467767fe1e3c53de3dee89bf0.tar.gz bcm5719-llvm-27695da998b0934467767fe1e3c53de3dee89bf0.zip |
[Tooling] Correct the "-std" compile command option.
Summary:
"-std c++11" is not valid in compiler, we have to use "-std=c++11".
Test in vscode with this patch, code completion for header works as expected.
Reviewers: sammccall
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D45512
llvm-svn: 329786
Diffstat (limited to 'clang/lib/Tooling/InterpolatingCompilationDatabase.cpp')
-rw-r--r-- | clang/lib/Tooling/InterpolatingCompilationDatabase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp index cf29744f307..bc564584bd0 100644 --- a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp +++ b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp @@ -191,9 +191,9 @@ struct TransferableCommand { // --std flag may only be transferred if the language is the same. // We may consider "translating" these, e.g. c++11 -> c11. if (Std != LangStandard::lang_unspecified && foldType(TargetType) == Type) { - Result.CommandLine.push_back("-std"); Result.CommandLine.push_back( - LangStandard::getLangStandardForKind(Std).getName()); + "-std=" + + std::string(LangStandard::getLangStandardForKind(Std).getName())); } Result.CommandLine.push_back(Filename); return Result; |