aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Support/CommandLine.cpp2
-rw-r--r--support/lib/Support/CommandLine.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
index 9890ee2..39bff48 100644
--- a/lib/Support/CommandLine.cpp
+++ b/lib/Support/CommandLine.cpp
@@ -375,7 +375,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
// positional option and keep the rest for the consume after. The above
// loop would have assigned no values to positional options in this case.
//
- if (PositionalOpts.size() == 2 && ValNo == 0)
+ if (PositionalOpts.size() == 2 && ValNo == 0 && !PositionalVals.empty())
ErrorParsing |= ProvidePositionalOption(PositionalOpts[1],
PositionalVals[ValNo++]);
diff --git a/support/lib/Support/CommandLine.cpp b/support/lib/Support/CommandLine.cpp
index 9890ee2..39bff48 100644
--- a/support/lib/Support/CommandLine.cpp
+++ b/support/lib/Support/CommandLine.cpp
@@ -375,7 +375,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
// positional option and keep the rest for the consume after. The above
// loop would have assigned no values to positional options in this case.
//
- if (PositionalOpts.size() == 2 && ValNo == 0)
+ if (PositionalOpts.size() == 2 && ValNo == 0 && !PositionalVals.empty())
ErrorParsing |= ProvidePositionalOption(PositionalOpts[1],
PositionalVals[ValNo++]);