[llvm-bugs] [Bug 29054] New: clang api gets confused by positional arguments
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Aug 19 04:12:46 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=29054
Bug ID: 29054
Summary: clang api gets confused by positional arguments
Product: clang
Version: 3.9
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Driver
Assignee: unassignedclangbugs at nondot.org
Reporter: moritz.kiefer at purelyfunctional.org
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
Steps to reproduce:
Download and compile
https://gist.github.com/cocreature/5b511b3de6f2e2e2e08e48ec3ce25dcc and try to
run it with a single argument. That file identical to the clang-interpreter
example with the exception of one (unused) positional argument added via
llvm::cl (and some debug output).
Then try to run it and pass an arbitrary C file as the single argument.
Expected:
It compiles to an LLVM module and then tries to interpret it.
Actual behavior:
The call to CompilerInstance::ExecuteAction fails with the following error
message:
clang: Not enough positional command line arguments specified!
Must specify at least 1 positional arguments: See: clang -help
Comments:
Adding an unused argument is obviously not useful but I am encountering this
bug in a tool of mine where we actually use positional arguments so just
removing them is not an option (or would require us to switch to a different
cli arg parser). This is new behavior in 3.9 (3.8 works fine). I assume it is
not intended, but if so, is there a way around this?
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160819/e6f8730f/attachment-0001.html>
More information about the llvm-bugs
mailing list