diff options
-rw-r--r-- | tools/driver/driver.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index dbfc293655..c69b29c1ed 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -208,7 +208,9 @@ int main(int argc, const char **argv) { // // Note that we intentionally want to use argv[0] here, to support "clang++" // being a symlink. - std::string ProgName(llvm::sys::Path(argv[0]).getBasename()); + // + // We use *argv instead of argv[0] to work around a bogus g++ warning. + std::string ProgName(llvm::sys::Path(*argv).getBasename()); if (llvm::StringRef(ProgName).endswith("++") || llvm::StringRef(ProgName).rsplit('-').first.endswith("++")) TheDriver.CCCIsCXX = true; |