aboutsummaryrefslogtreecommitdiff
path: root/tools/driver/driver.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-11-20 11:49:06 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-11-20 11:49:06 +0000
commitd5dc9f34ef2288ace0003e1fee011cc9e7d2d040 (patch)
tree2a88469fe3214d9ae30304d08b0d6136d56c25af /tools/driver/driver.cpp
parent921ddc4e7ef35d77965205d91582c356cb54f5ef (diff)
Add a workaround to silence a bogus g++-4.4 -pedantic warning.
driver.cpp:211: warning: ISO C++ forbids zero-size array 'argv' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/driver.cpp')
-rw-r--r--tools/driver/driver.cpp4
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;