]> granicus.if.org Git - llvm/commit
[CommandLine] Do not crash if an option has both ValueRequired and Grouping.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Fri, 1 Mar 2019 09:20:56 +0000 (09:20 +0000)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Fri, 1 Mar 2019 09:20:56 +0000 (09:20 +0000)
commit54df8c81aed5ba1b43d8f760cd1d0af1f75e39fc
treea6e5720d82b08edacd427749278d84b5aec4a993
parentb4ec9009a62f5966fd723d9dc89eac2216bf122c
[CommandLine] Do not crash if an option has both ValueRequired and Grouping.

If an option, which requires a value, has a `cl::Grouping` formatting
modifier, it works well as far as it is used at the end of a group,
or as a separate argument. However, if the option appears accidentally
in the middle of a group, the program just crashes. This patch prints
an error message instead.

Differential Revision: https://reviews.llvm.org/D58499

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355184 91177308-0d34-0410-b5e6-96231b3b80d8
docs/CommandLine.rst
lib/Support/CommandLine.cpp
unittests/Support/CommandLineTest.cpp