diff options
author | Chris Lattner <sabre@nondot.org> | 2002-07-22 02:21:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-07-22 02:21:57 +0000 |
commit | 54ec7aed89e4a5d8cc11c36999d88012cbfcc18a (patch) | |
tree | 154f11780f5c23425d49582a25092b9f5e9f2f2f /lib/Support/CommandLine.cpp | |
parent | 54e05afa3c1e8e2ac1580e25c49a7d1bc9377727 (diff) |
Minor bugfix, prevents error in LLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2989 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/CommandLine.cpp')
-rw-r--r-- | lib/Support/CommandLine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index d11fbd7119..001fdac476 100644 --- a/lib/Support/CommandLine.cpp +++ b/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! |