Give an error if “@obj” is used without importing ObjectiveC.

The standard library is exemptmpt (-parse-stdlib) from this checking.

Implements <rdar://problem/16559137>.

Swift SVN r16155
This commit is contained in:
Ted Kremenek
2014-04-10 09:08:09 +00:00
parent 1f47262325
commit 2d4342b87a
10 changed files with 63 additions and 1 deletions

View File

@@ -526,6 +526,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.DebuggerSupport = true;
}
if (auto A = Args.getLastArg(OPT_enable_objc_attr_requires_objc_module,
OPT_disable_objc_attr_requires_objc_module)) {
Opts.EnableObjCAttrRequiresObjCModule
= A->getOption().matches(OPT_enable_objc_attr_requires_objc_module);
}
if (const Arg *A = Args.getLastArg(OPT_debug_constraints_attempt)) {
unsigned attempt;
if (StringRef(A->getValue()).getAsInteger(10, attempt)) {