From d49ea884888f76d1ea5188c493adcadc3f646b61 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 22 Jul 2002 02:21:57 +0000 Subject: Minor bugfix, prevents error in LLI llvm-svn: 2989 --- llvm/lib/Support/CommandLine.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Support/CommandLine.cpp') diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index d11fbd7119e..001fdac476d 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -168,10 +168,12 @@ void cl::ParseCommandLineOptions(int &argc, char **argv, ++NumPositionalRequired; else if (ConsumeAfterOpt) { // ConsumeAfter cannot be combined with "optional" positional options - ErrorParsing |= - Opt->error(" error - this positional option will never be matched, " - "because it does not Require a value, and a " - "cl::ConsumeAfter option is active!"); + // unless there is only one positional argument... + if (PositionalOpts.size() > 2) + ErrorParsing |= + Opt->error(" error - this positional option will never be matched, " + "because it does not Require a value, and a " + "cl::ConsumeAfter option is active!"); } else if (UnboundedFound) { // This option does not "require" a value... // Make sure this option is not specified after an option that eats all // extra arguments, or this one will never get any! -- cgit v1.2.3