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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154231
91177308-0d34-0410-b5e6-
96231b3b80d8
} 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
--- /dev/null
+// RUN: %clang -target x86_64-apple-darwin10 \
+// RUN: -Werror -x c -x c -fsyntax-only %s