From 6c0e053dc99a0e214f03f2d607b935c76a21c5ad Mon Sep 17 00:00:00 2001 From: Patrik Hagglund Date: Thu, 18 Sep 2014 11:52:57 +0000 Subject: [PATCH] Alternative (to r216344) fix of gcc -Wpedantic. As suggested by David Blaikie, this may be easier to read. The original warning was: ../tools/llvm-cov/llvm-cov.cpp:53:49: error: ISO C++ forbids zero-size array 'argv' [-Werror=pedantic] std::string Invocation(std::string(argv[0]) + " " + argv[1]); It seems to be the case that GCC's warning gets confused and thinks 'argv' is a declaration here. GCC bugzilla issue #61259. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218048 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-cov/llvm-cov.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/llvm-cov/llvm-cov.cpp b/tools/llvm-cov/llvm-cov.cpp index 0a540b7a929..8c1ad8bedb3 100644 --- a/tools/llvm-cov/llvm-cov.cpp +++ b/tools/llvm-cov/llvm-cov.cpp @@ -50,7 +50,7 @@ int main(int argc, const char **argv) { func = gcov_main; if (func) { - std::string Invocation(std::string() + argv[0] + " " + argv[1]); + std::string Invocation = std::string(argv[0]) + " " + argv[1]; argv[1] = Invocation.c_str(); return func(argc - 1, argv + 1); } -- 2.34.1