forked from OSchip/llvm-project
[driver] In general, the driver claims redundant args and uses the last arg.
However, the '-x' option has special handling and wasn't following this paradigm. Fix it to do so by claiming the arg as we parse the '-x' option. rdar://11203340 llvm-svn: 154231
This commit is contained in:
parent
372787fc19
commit
706c235013
|
@ -1003,6 +1003,7 @@ void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args,
|
|||
} else if (A->getOption().matches(options::OPT_x)) {
|
||||
InputTypeArg = A;
|
||||
InputType = types::lookupTypeForTypeSpecifier(A->getValue(Args));
|
||||
A->claim();
|
||||
|
||||
// Follow gcc behavior and treat as linker input for invalid -x
|
||||
// options. Its not clear why we shouldn't just revert to unknown; but
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
// RUN: %clang -target x86_64-apple-darwin10 \
|
||||
// RUN: -Werror -x c -x c -fsyntax-only %s
|
Loading…
Reference in New Issue